Service layer session migration and sharing

ABSTRACT

Methods, devices, and systems for migration or sharing of existing M2M service layer sessions are disclosed. In one embodiment, a Session Migration and Sharing Function (SMSF) performs the migration or sharing of a M2M service layer session. Various forms of service layer session context may be used to enable the migration and sharing of M2M service layer sessions.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a National Stage Application filed under 35 U.S.C. §371 of International Application No. PCT/US2015/050929, filed Sep. 18,2015, which claims priority to, and the benefit of, Provisional U.S.Patent Application No. 62/052,535, filed Sep. 19, 2014, the disclosureof which is hereby incorporated by reference as if set forth in itsentirety herein.

BACKGROUND

A communication session may involve a persistent interactive exchange ofinformation between two or more communicating entities (e.g. devices,applications, etc.). A communication session is established at a certainpoint in time, and torn down at a later point in time based on variouscircumstances (e.g. after the session times out or when one of theentities decides to terminate the session). A communication session mayinvolve the exchange of multiple messages between entities and may bestateful, meaning that at least one of the communicating entities savesinformation about the session history in order to be able to maintainthe communication session—for example, maintaining session context suchas connectivity, registration, security, scheduling, and data that isapplicable to the session participants.

Communication sessions may be implemented as part of protocols andservices at various layers in a network protocol stack. For example,communication connections/sessions may be established between networknodes at the transport protocol layer (e.g. TCP connection), sessionprotocol layer (e.g. TLS and DTLS sessions), Web transport protocollayer (e.g. HTTP and CoAP sessions), machine-to-machine (M2M)/Internetof Things (IoT) service layer, and at the application layer (e.g.,application-specific sessions). The present application relatesprimarily to features targeting M2M/IoT service layer sessions.

A conventional application session is a communication session betweentwo or more applications that is established and managed by theapplications themselves rather than by an underlying communicationprotocol or service layer. As a result, application sessions can addextra overhead and complexity to applications.

A machine-to-machine (M2M) service layer provides value-added servicesfor M2M type devices and applications. For example, an M2M service layercan support Application Programming Interfaces (APIs) providingapplications and devices access to a collection of M2M centriccapabilities supported by the service layer. A few examples includesecurity, charging, data management, device management, discovery,provisioning, and connectivity management. These capabilities are madeavailable to applications via APIs which make use of message formats,resource structures and resource representations defined by the M2Mservice layer.

A M2M service layer session is a communication session that isfacilitated by the value-added session management services supported bya M2M service layer. These services can include capabilities such asmechanisms for establishing a service layer session between participantsas well as collecting and maintaining context pertinent to the servicelayer session and its participants. A service layer session can beestablished between two or more M2M service layer session participantswhere these participants can be M2M applications and/or M2M servicelayer instances. At a minimum however, at least one instance of a M2Mservice layer must participate in the session to function as thefacilitator of the service layer session (i.e. provide the necessaryservice layer session management functionality).

One benefit of M2M service layer sessions is they can be used to offloadapplications from the burden of having to establish and maintain theirown application-based sessions. This is because a M2M service layersession differs from an application session in that, the brunt of theoverhead involved with establishing and maintaining the session isoffloaded to the M2M service layer such that M2M applications are notburdened with this responsibility. Some examples of overhead that can beoffloaded to the service layer can include creation and management ofsession context such as credentials, identifiers, routing information,discovery information, location, transaction history, and data. Anotherbenefit is a M2M service layer session can be layered on top of one ormore underlying transport or access network communication sessions. Someexamples include but are not limited to Web transport protocol sessions(e.g. HTTP session), session layer sessions (e.g. TLS session), ortransport layer connections (e.g. TCP). This layering allows a M2Mservice layer session to support persistency with regards to lower layersessions such that the M2M service layer session can persist and bemaintained independent of the setup and tear down of lower layersessions. For example, a M2M service layer session can persist in spiteof its underlying TCP/TLS sessions being repeatedly setup and torn-downwhich is fairly typical during the course of normal networkcommunication (e.g. due to power saving methods and mobility).

The establishment of a M2M service layer session between sessionparticipants may either be initiated as part of the service layerregistration process or as a separate process thereafter. Onceestablished, a service layer session can be used to collect and maintainservice layer context pertaining to the session participants and thecommunication that takes place between them. For example, service layersession context such as registration state and security credentials ofsession participants, subscription criteria and contact information forsession participants, session participant data stored in service layerresources, and history of transactions performed by sessionparticipants, may be collected and maintained for each session. Thetermination of a M2M service layer session between session participantscan either be initiated as part of the service layer de-registrationprocess or as a separate process performed before de-registration takesplace.

Establishment of a service layer session as well as the accumulation ofservice layer session context during the lifetime of a particularservice layer session may involve a significant amount time and efforton behalf of the session participants. Hence, the persistent nature of aservice layer session is one of its major value-add differentiatorscompared to lower layer transport and access network sessions which lackthis persistency. A persistent service layer session can be used tomaintain service layer session context on behalf of applications suchthat they do not have to maintain this information themselves. Inaddition, when a lower layer connection/session is torn down the servicelayer session context can persist and when the lower layer connection isre-established, this context will still be available to an application.Hence this context can be maintained independent of non-persistentunderlying transport sessions. Some examples of service layer sessioncontext may include service layer registrations, subscriptions,credentials, identifiers, charging records, routing information,discovery information, location, transaction history, and data forapplications.

SUMMARY

Existing M2M service layers lack support for migrating or sharing M2Mservice layer session context from one service layer instance to anotherservice layer instance. Similarly they also lack support for migratingor sharing M2M service layer session context between M2M applicationinstances. This lack of functionality prevents a M2M service layer fromsupporting persistency of service layer sessions for use cases involvingmobile session participants, changes in session participants addressessuch as getting assigned new IP addresses, or use cases involvingsharing service layer sessions with new session participants.

Disclosed herein are methods, devices, and systems for migration orsharing of an existing M2M service layer session with one or moresession participants. In one embodiment, a Session Migration and SharingFunction (SMSF) performs the migration or sharing of a M2M service layersession. Additionally, various forms of service layer session contextmay be used to enable the migration and sharing of M2M service layersessions.

This Summary is provided to introduce a selection of concepts in asimplified form that are further described below in the DetailedDescription. This Summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used to limit the scope of the claimed subject matter. Furthermore,the claimed subject matter is not constrained to limitations that solveany or all disadvantages noted in any part of this disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

A more detailed understanding may be had from the following description,given by way of example in conjunction with the accompanying drawingswherein:

FIG. 1A illustrates an example of various layers in a network protocolstack;

FIG. 1B illustrates an example end-to-end (E2E) machine-to-machine (M2M)service layer session;

FIG. 2 illustrates an E2E M2M service layer session of FIG. 1B withadditional details;

FIG. 3 illustrates E2E M2M service layer sessions of FIG. 1B with yetfurther details;

FIG. 4 illustrates an exemplary method of session credential functionbootstrapping;

FIG. 5 illustrates a functional architecture for an E2E M2M servicelayer session manager;

FIG. 6 illustrates an exemplary E2E M2M service layer sessionestablishment call flow;

FIG. 7 illustrates an exemplary service layer session between twosession endpoints with multiple routes;

FIG. 8 illustrates a functional architecture for a session endpoint;

FIG. 9 illustrates a oneM2M embodiment of a session manager;

FIG. 10A illustrates an E2E M2M service layer session establishmentprocedure for a oneM2M session management (SMG) service;

FIG. 10B illustrate an E2E M2M service layer session establishmentprocedure for a oneM2M session management (SMG) service continued fromFIG. 10A;

FIG. 11A illustrates a session usage procedure for a oneM2M SMG service;

FIG. 11B illustrates a session usage procedure for a oneM2M SMG servicecontinued from FIG. 11A;

FIG. 12 illustrates an exemplary M2M session termination procedure for aoneM2M SMG service;

FIG. 13 illustrates a resource “sessions”;

FIG. 14 illustrates sessions resource instantiation under a CSE BaseURI;

FIG. 15 illustrates sessions resource instantiation under an applicationresource;

FIG. 16 illustrates a resource <session>;

FIG. 17 illustrates a resource sessionEndpoints;

FIG. 18 illustrates a resource <sessionEndpoint>;

FIG. 19 illustrates a resource nextHops;

FIG. 20 illustrates a resource <nextHop>;

FIG. 21 illustrates a resource sessionPolicies;

FIG. 22 illustrates a resource <sessionPolicy>;

FIG. 23 illustrates a resource sessionContext;

FIG. 24 illustrates a resource <sessionContextlnstance>;

FIG. 25 illustrates an example use case for M2M session migration orsharing;

FIG. 26 illustrates another example use case for M2M session migrationor sharing;

FIG. 27 shows one example of M2M service layer session migration;

FIG. 28 shows one example of M2M service layer session sharing;

FIG. 29 illustrated one embodiment of a Session Migration and SharingFunction (SMSF) implemented as part of a service layer instance of anode of network;

FIG. 30 illustrates one embodiment of a method for migration or sharingof an existing M2M service layer session with one or more prospectivesession participants;

FIG. 31 illustrates one embodiment of a SMSF implemented as part of aService Session Management (SSM) Capability Service Function (CSF)within a Capability Services Entity (CSE) in accordance with a oneM2Marchitecture;

FIG. 32 shows a modification of a oneM2M <session> resource structure,in accordance with one embodiment;

FIG. 33 shows a modification of a oneM2M <sessionPolicy> resourcestructure, in accordance with one embodiment;

FIG. 34 shows a modification of a oneM2M <sessionContext> resourcestructure, in accordance with one embodiment;

FIG. 35 illustrates a <sessionContext> resource structure linked to a<sessionParticipant> resource structure, in accordance with oneembodiment;

FIGS. 36A-C illustrate one example embodiment of a method for migratinga one M2M service layer session;

FIG. 37A is a system diagram of an example machine-to-machine (M2M),Internet of Things (IoT), or Web of Things (WoT) communication system inwhich one or more disclosed embodiments may be implemented;

FIG. 37B is a system diagram of an example architecture that may be usedwithin the M2M/IoT/WoT communications system illustrated in FIG. 37A;

FIG. 37C is a system diagram of an example M2M/IoT/WoT terminal orgateway device that may be used within the communications systemillustrated in FIG. 37A;

FIG. 37D is a block diagram of an example computing system in whichaspects of the communication system of FIG. 37A may be embodied; and

FIG. 38 illustrates one embodiment of a graphical user interface thatmay be implemented to allow a user to interactively configure and managean end-to-end session migration policy.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

As mentioned above, communication sessions may be implemented as part ofprotocols and services at various layers in a network protocol stack.For example, as illustrated in FIG. 1A, communicationconnections/sessions may be established between network nodes at thetransport protocol layer 50 (e.g. TCP connection), session protocollayer 52 (e.g. TLS and DTLS sessions), Web transport protocol layer 54(e.g. HTTP and CoAP sessions), machine-to-machine (M2M)/Internet ofThings (IoT) service layer 56, and at the application layer 58 (e.g.,application-specific sessions). The present application relatesprimarily to features targeting sessions at the M2M/IoT service layer56.

A number of machine-to-machine (M2M) communications architectures havebeen proposed, including for example, the European TelecommunicationsStandards Institute (ETSI) M2M architecture described in ETSI TS 102 6901.1.1 (2011-10), the one M2M architecture described in one M2M-TS-0001one M2M Functional Architecture-V-0.1.2, the machine-type communication(MTC) architecture developed by The Third Generation Partnership Project(3GPP), and the Lightweight M2M architecture (LWM2M) developed by theOpen Mobile Alliance (OMA). Each of these architectures defines aservice layer, which is a software middleware layer that supportsvalue-added service capabilities through a set of ApplicationProgramming Interfaces (APIs) and underlying networking interfaces. ETSIM2M's service layer is referred to as the Service Capability Layer(SCL). The SCL may be implemented within an M2M device (where it isreferred to as a device SCL (DSCL)), a gateway (where it is referred toas a gateway SCL (GSCL)) and/or a network node (where it is referred toas a network SCL (NSCL)). The one M2M service layer supports a set ofCommon Service Functions (CSFs) (i.e. service capabilities). Aninstantiation of a set of one or more particular types of CSFs isreferred to as a Common Services Entity (CSE) which can be hosted ondifferent types of network nodes (e.g. infrastructure node, middle node,application-specific node). In the 3GPP MTC architecture, the servicelayer, and the service capabilities it provides, are implemented as partof a Service Capability Server (SCS). Whether embodied in a DSCL, GSCL,or NSCL of the ETSI M2M architecture, in a Service Capability Server(SCS) of the 3GPP MTC architecture, in a CSF or CSE of the oneM2Marchitecture, or as some other component or module of another M2Marchitecture, the service layer may be implemented as a logical entity(e.g., software, computer-executable instructions, and the like)executing either on one or more standalone nodes of the network, such asservers, computers, or other computing devices or nodes, or as part ofone or more existing nodes of such network. As an example, a servicelayer or component thereof may be implemented in the form of softwarerunning on a node or computing system having the general architectureillustrated in FIG. 37C or FIG. 37D described below.

Existing M2M service layers lack support for migrating or sharing M2Mservice layer session context from one service layer instance to anotherservice layer instance. Similarly they also lack support for migratingor sharing M2M service layer session context between M2M applicationinstances. This lack of functionality prevents a M2M service layer fromsupporting persistency of service layer sessions for use cases involvingmobile session participants, changes in session participants addressessuch as getting assigned new IP addresses, or use cases involvingsharing service layer sessions with new session participants.

Lack of support for migrating M2M service session context can alsocreate limitations or overhead for M2M sensors. For example,establishing a M2M service layer session from scratch can involve asignificant number of M2M service layer requests that can include butare not limited to requests for registering to the service layer,creating container resources to store its sensor readings, creatingsubscriptions to the service layer to receive notifications it isinterested in, configuring event generation conditions within theservice layer, and configuring message delivery and handling policieswithin the service layer. By supporting the migration and sharing ofservice layer session context between service layer instances, thisoverhead on M2M sensors can be minimized.

Lack of support for migrating M2M service session context can alsocreate limitations or overhead for M2M applications, lack of support formigrating M2M service session context can also prevent M2M servicelayers from providing value-added services such as migration/sharing ofservice layer data (e.g. resource representations) to service layerinstances that are closer to the applications that are accessing andusing the data.

Disclosed herein are methods, devices, and systems for migration orsharing of an existing M2M service layer session with one or moresession participants.

Example Service Layer Session Management Mechanisms

Before discussing service layer session migration and sharing below,exemplary mechanisms for providing end-to-end (E2E) session support inan M2M service layer are provided below with reference to FIGS. 1-24. Itis understood, however, that the service layer session migration andsharing concepts described hereinafter are by no means limited to theservice layer session mechanisms disclosed in this section. Rather,these mechanisms are provided merely as one example of how service layersessions may be implemented.

E2E M2M service layer sessions (service layer sessions) are sessionsthat allow an M2M service layer to participate in end-to-end securityservices, end-to-end quality of service functionality, end-to-endnegotiation of settings or configuration, among other value-addedsession functionality, such as data aggregation and data analytics. Themethods and functional architectures discussed herein (e.g., FIG. 4,FIG. 5, and throughout) may be implemented by a combination of softwareand hardware. The functional architectures may be implemented on asingle device or distributed among multiple devices. The devices may beone or more of the devices as described below with regard to FIG. 37Athrough FIG. 37D.

For additional perspective, FIG. 1B illustrates exemplary E2E M2Mservice layer sessions that span multiple hops. As illustrated in FIG.1B, an M2M device 110 may include an M2M application 111. M2Mapplication 111 may be involved in an E2E M2M service layer session withM2M network application 115 (an endpoint M2M application that may be ona device such as a tablet, server, personal computer, or smartphone).The M2M service layer session of M2M application 111 includes multiplehops (hop 130 and hop 131) and is facilitated by M2M service layerinstance 123 located on M2M server 118.

FIG. 1B also shows an example of a service layer session facilitated bytwo M2M service layer instances; one hosted on an M2M server and anotheron an M2M gateway. As shown in FIG. 1B, M2M application 113 of M2Mdevice 112 may be involved in an E2E M2M service layer session with M2Mnetwork application 115. The M2M service layer session of M2Mapplication 113 includes multiple hops (hop 132, 133, and hop 134) andis facilitated by multiple M2M service layer instances (M2M servicelayer instance 121 of M2M gateway 114 and M2M service layer instance 123of M2M server 118). M2M service layer instance 121 and M2M service layerinstance 123 may communicate with one another to manage the E2E M2Mservice layer session (e.g., establish the session or tear-down thesession).

FIG. 1B also shows a service layer session that is involved in a sessionbetween two M2M gateways. As shown in FIG. 1B, M2M service layerinstance 125 of M2M gateway 116 is in an M2M service layer session withM2M service layer instance 121 of M2M gateway 114. The M2M service layersession of M2M service layer instance 125 includes multiple hops (hop136 and hop 135) and is facilitated by M2M service layer instance 123 ofM2M server 118. Additional examples (not shown) are possible for E2E M2Mservice layer sessions. For example, an E2E M2M service layer sessionmay be between two M2M servers that are multiple service layer hops awayfrom one another. Another example may involve a direct E2E sessionbetween two endpoint applications, which does not flow through the M2Mservice layer but is facilitated by the M2M service layer. In otherwords, the service layer may provide application discovery and E2Esession credential establishment services that applications may use todiscover each other and dynamically provision credentials. As yetanother example, an M2M service layer session may be establisheddirectly between an M2M application on a device and an M2M service layerinstance on an M2M gateway. As another example, an M2M service layersession may be established directly between an M2M service layerinstance on an M2M gateway and the service layer instance on an M2Mserver. As yet another example, an M2M service layer session may beestablished between three or more M2M applications on multiple devices,which might span one, two or more M2M service layer instances on, forexample, one or more M2M gateways or servers.

As described in more detail below, to support service layer sessions,one or more of the following M2M service layer architectural elementsmay exist: an E2E M2M service layer session manager function (sessionmanager function), E2E M2M service layer session endpoint function(session endpoint function), E2E M2M service layer session credentialbootstrapping function (session credential function), M2M Service layersession state (session state), and E2E M2M service layer sessioninterfaces (session interface). FIG. 2 is an illustration of an M2Msession in FIG. 1B, which includes the aforementioned M2M service layerarchitectural elements. M2M session endpoint functions, such as sessionendpoint function 140, session endpoint function 149, and sessionendpoint function 148, may respectively reside with M2M device 110, M2Mserver 118, and M2M network application 115. As discussed in more detailherein, a session endpoint function enables an M2M application or M2Mservice layer instance to participate in a service layer session. Thesession endpoint function interacts with a session manager.

With continued reference to FIG. 2, an E2E M2M service layer sessionmanager (e.g., session manager 145) may reside within an M2M server(e.g., M2M server 118) or an M2M gateway. Although not shown in FIG. 2,the E2E M2M service layer session manager could also reside on an M2Mdevice if the device itself hosts a service layer. As discussed in moredetail below, a session manager supports establishment, tear-down, andmanagement of service layer sessions. The session manager may performtranslations of session addresses or identifier address (e.g.,translating between a public session identifier and private sessionidentifier). In addition, the session manager supports the capability toroute service layer messages to other session managers such that thesemessages may be delivered to session endpoints not directly connected toit.

With further reference to FIG. 2, M2M service layer sessions may involvea session credential function, such as session credential function 147.Session credential function 147 may support provisioning orbootstrapping of service layer session related credentials andconfiguration information. Session managers or session endpoints may usethese session credentials. The session credential function may reside onan AAA server and have a I_(credential) interface (e.g., I_(Credential)157) that uses the Diameter protocol. In addition, service layersessions may include a session state, which any of the M2M devices mayhave, such as M2M device 110, M2M server 118, and M2M network 115.Session state is information that may be maintained by session managersor session endpoints and may be used for session management purposes.

FIG. 3 illustrates multiple examples of service layer sessions of FIG.1B that include the aforementioned M2M service layer architecturalelements. As shown in FIG. 3, there may be an I_(Manager-Manager)interface between session managers (e.g., I_(Manager-Manager) 154) andan I_(Endpoint-Manager) interface between a session endpoint and sessionmanager (e.g., I_(Endpoint-Manager) 153, I_(Endpoint-Manager) 155,I_(Endpoint-Manager) 156). As shown in FIG. 3, session manager 145manages multiple M2M service layer sessions between multiple nodes.

Below are more detailed methods and system descriptions with regard tosome of the functions of FIG. 3, such as a session credential function,a session manager, and session state information, among other things.

A session credential function supports bootstrapping of session securitycredentials (“security credentials” or “session credentials”) to theindividual session endpoints, as well as the session managers making upthe service layer session that spans multiple service layer hops, wherethe service layer hop may be defined as a direct service layercommunication link between two or more of the following: a service layerinstance or application. As discussed herein, session credentials andsecurity credentials for securing the session are used synonymously. Amethod (not shown) of provisioning the session credentials may be apre-provisioning step that is performed by the manager or owner of thesession credential function. For example, per each service layerinstance, a pool of session credentials may be pre-provisioned into thesession credential function. Thereafter the session manager may makerequests to the session credential function to allocate sessioncredentials when required.

FIG. 4 illustrates an exemplary method of session credential functionbootstrapping, which configures the session credentials betweendifferent session participants, which may reside on an M2M device, M2Mserver, M2M gateway, or the like. It may be assumed for FIG. 4 thatsession endpoint 140 is part of the initiating application, whilesession endpoint 148 is part of the targeted application.

At step 201, step 202, and step 203, a secure single-hop session may beestablished. At step 201, nthe secure single-hop session is betweensession manager 145 and session credential function 147. At step 202,the secure single-hop session is between session manager 145 and sessionendpoint 140. At step 203, the secure single-hop session is betweensession manager 145 and session endpoint 148. The secure single-hopsessions of step 201, step 202, and step 203 may be established byconventional service layer bootstrap and registration proceduressupported in architectures such as ETSI M2M and OMA LWM2M.

At step 204, session endpoint 140 may query session manager 145 (e.g.,provide a session credential bootstrap request) to discover othersession endpoints that are available and their corresponding attributesor request a particular session endpoint. An alternative to explicitlydiscovering other session endpoints is for session endpoint 140 toprovide information within the bootstrap request of step 204, such asthe type of session endpoints it wishes to establish a session with andlet the session manager decide the best session endpoint. A sessioncredential bootstrap request may be initiated by a session endpoint thatis associated with an application, gateway, server, or the like, thatwants to establish a service layer session. The session credentialbootstrap request may contain information, such as one or more targetedsession endpoints that the initiating session endpoint is looking toestablish a service layer session with. In addition, the sessioncredential bootstrap request may contain information with regard to adesired type of session endpoint, which a session manager may use toselect one or more targeted session endpoints to distribute servicelayer session credentials. The session credential bootstrap request mayalso include information such as the required QoS of the session,location of a targeted session endpoint, and amount that the initiatingapplication is willing to pay, among other things.

At step 205, session manager 145 parses the session credential bootstraprequest of step 204 to determine the targeted session endpoints it ispermitted to distribute a session credential to, or alternatively, whichsession endpoints it may ask to bootstrap with session credentialfunction 147. In addition, session manager 145 determines anyintermediate service layer instances (e.g., M2M gateways or M2M serverswith service layer instances) that may be involved in the service layersession. The determination of the targeted session endpoints andintermediate service layer instances may be performed in different ways.For example, session manager 145 may use information included with thesession credential bootstrap request at step 204, such as a list oftargeted session endpoints. Alternatively, history or contextinformation maintained as session state by the requesting sessionendpoint (e.g., session endpoint 140) or session policies may also beused. Using the session state, session manager 145 may further qualifywhich targeted session endpoints it selects to distribute sessioncredentials to.

With continued reference to FIG. 4, at step 206, session manager 145 maysend an E2E M2M session credential request to session credentialfunction 147. The credential request of step 206 may include a requestto allocate a set of session credentials for the determined targetedsession endpoints and the determined service layer instances of step205. At step 207, session credential function 147 creates a set ofsession credentials for session manager 145, session endpoint 148, andsession endpoint 140. Additionally at step 207, credential function 147maintains a state of the session credentials. The credential state maybe sent to any application, instance, or the like that may desiresession credentials of an already created service layer session. At step208, session credential function 147 sends to session manager 145 an E2EM2M session credential response. The session credential response mayinclude a session credential that may be allocated to any number ofapplications or service layer instances. Alternatively, the credentialresponse may include a set of session credentials, each sessioncredential in the set of session credentials may be particularlyassigned to service layer instance or application that is involved theservice layer session that is desired to be created.

At step 209, upon receiving the session credentials of step 208, sessionmanager 145 may store the session credentials locally such that sessionmanager 145 may also use the session credentials. For example, sessionmanager 145 may encrypt or decrypt application data flowing through theservice layer instance (e.g., service layer instance 123) and providevalue-add data services. At step 210, session manager 145 sends tosession endpoint 148 an E2E session credentials configuration request,which may include the session credentials of step 208. The E2E sessioncredentials configuration request may also include a request for theability of session endpoint 148 to participate in service layer sessionwith session endpoint 140. For example, the session endpoint 148 mayhave policies in place that may not allow for service layer session atthat time. At step 211, session endpoint 148 maintains sessioncredential state for the proposed session. At step 212, session endpoint148 sends to session manager 145 an E2E session credentialsconfiguration response, which may include confirmation of receiving andimplementing the sent session credentials.

With further reference to FIG. 4, at step 213, session manager 145 maysend to session endpoint 140 an E2E security credential bootstrapresponse. E2E security credential bootstrap response of step 213 mayultimately be in response to the request of step 204 and may include thesession credentials, as well as a list of targeted session endpointswith the session credentials for a service layer session. At step 214,upon receiving the session credentials, session endpoint 140 maymaintain the state information of the received credentials.

With continued reference to FIG. 4, the session endpoints (e.g., sessionend point 140 and session endpoint 148) may need to repeat thebootstrapping operation periodically in order to refresh the sessioncredentials. This periodic refresh may be based on a lifetime associatedwith the session credential. Securely bootstrapping with the commonsession credentials may establish a secure chain of trust between theinitiating session endpoint 140, local session manager 145 (directlyregistered session manager for session endpoint 140), any intermediateservice layer session managers (not shown here, but at times may beapplicable), and one or more targeted E2E M2M service layer sessionendpoints (e.g., session end point 148). This secure E2E chain of trustmay be layered upon the secured underlying conventional single-hop M2Mservice layer sessions as well as the secured underlying transport layerand access network connections that may exist. Alternatively, theaforementioned secure E2E chain of trust may be established by havingeach session endpoint and session manager authenticate with the sessioncredential function rather than with one another in a hop-by-hopfashion.

It is understood that the entities performing the steps illustrated inFIG. 4 are logical entities that may be implemented in the form ofsoftware (i.e., computer-executable instructions) stored in a memory of,and executing on a processor of, a network node or computer system suchas those illustrated in FIG. 37C or FIG. 37D. That is, the method(s)illustrated in FIG. 4 may be implemented in the form of software (i.e.,computer-executable instructions) stored in a memory of a network node,such as the node or computer system illustrated in FIG. 37C or FIG. 37D,which computer executable instructions, when executed by a processor ofthe node, perform the steps illustrated in FIG. 4.

Session credentials may be bootstrapped to the initiating M2Mapplication, as well as to the M2M service layer instance it isregistered to, as well as one or more targeted M2M applications. Thecredentials may also be bootstrapped to other M2M service layerinstances, based on service layer routing policies, context information,or history information (e.g. if other M2M service layer instances existin a multi-hop path between the initiating M2M application and thetargeted M2M application).

FIG. 5 illustrates a functional architecture for an E2E M2M servicelayer session manager (e.g., session manager 145). As shown in FIG. 5,session manager 145 may include a session credential function 147, anE2E M2M session context and history function 161 (session contextfunction), an E2E M2M session routing function 162 (session routingfunction), an E2E M2M session establishment and teardown function 163(session establishment function), an E2E M2M session policy function 164(session policy function), an E2E M2M session configuration anddiscovery function 165 (session configuration function), an E2E M2Msession data management function 166 (session data management function),and a session state 151. In an embodiment, session manager 145 may besupported as a capability of an M2M service layer instance (e.g.,service layer instance 123). In another embodiment, session manager 145may be supported as a separate service(e.g., a standalone Web service),which an M2M service layer instance may interface with. Discussed inmore detail herein are descriptions of each of the functions of thesession manager.

E2E M2M session establishment and teardown function 163 (sessionestablishment function) processes requests for establishing or tearingdown service layer sessions. A session endpoint may send requests tosession establishment function to establish a service layer session withone or more targeted session endpoints. If credentials have beensuccessfully bootstrapped or provisioned or if security is not requiredthen session establishment function may proceed with establishing ortearing down a service layer session when requested. An E2E M2M servicelayer session can be established by layering a service layer sessionover top of existing single-hop M2M service layer sessions or transportlayer sessions. This can be achieved by maintaining and/or distributingsession state for each session endpoint as well as for each intermediatesession manager along the service layer session path. This session statemay include information such as the session security credentials,session routing information, session context, and session policies.Configuration of session state on each session endpoint and sessionmanager may be managed by a designated session manager (e.g., thesession manager closest to the session endpoint that initiates a servicelayer session establishment request).

FIG. 6 illustrates an example E2E M2M service layer sessionestablishment call flow. In this example, session endpoint 140 initiatesa service layer session with session endpoint 148 that is three servicelayer hops away (i.e., separated by two M2M service layer instances). Atstep 220, session endpoint 140, session endpoint 148, and the sessionmanagers (e.g., session manager 141 and session manager 145) have beenbootstrapped or provisioned with E2E M2M service layer sessioncredentials, as described herein (see example regarding FIG. 4). At step221, session endpoint 140 sends to session manager 141 a request toauthenticate and establish a service layer session. The request of step221 may include session credentials received at step 220. In anembodiment (not shown) session endpoint 140 may send multiple requeststo one or more session managers to establish an E2E M2M service layersession with multiple targeted session endpoints (e.g., a groupsession).

At step 222, session manager 141 authenticates session endpoint 140based on the session credentials of session endpoint 140. In addition,at step 222, session manager 141 determines the next hop to forward therequest to authenticate and establish the service layer session. Sessionmanager 141 determines the next hop based on information contained inthe request, locally stored context and polices, and by collaboratingwith other session managers in a network. In this example, the next hopis another session manager (e.g., session manager 145). As shown in FIG.6, at step 23, session manager 141 sends to session manager 145 arequest to authenticate and establish the service layer session. Therequest of step 223 may include session credentials received at step220. At step 224, session manager 145 authenticates session manager 141based on the session credentials of session manager 141 and determinesthe next hop to forward the request to authenticate and establish theservice layer session. At step 225, session manager 145 sends to sessionendpoint 148 a request to authenticate and establish the service layersession, as similarly done at step 221. At step 226, session endpoint148 authenticates session manager 145 based on the session credentials,determines that session endpoint 140 desires to communicate with it, andauthenticates the session endpoint 140 based on the session credentials.Also at step 226, session endpoint 148 may store session stateinformation, which is described in more detail below.

At step 227, session endpoint 148 sends to session manager 145 an E2Esession response. The E2E session response of step 227 may include aresponse confirming the establishment of a service layer session withsession endpoint 140, as well as other service layer session stateinformation. The E2E session response of step 227 is continuallyforwarded to session endpoint 140 at step 229 and step 231. As theresponse of step 225 is forwarded back for each hop, service layersession state information is stored by each session manager at step 228and step 230, as well as the initiating session endpoint (sessionendpoint 140) at step 232. This service layer session state informationis used to maintain the service layer session such that the servicelayer session may be used to exchange messages E2E between the sessionendpoints via the session managers.

With continued reference to FIG. 6, a session manager (e.g., sessionmanager 141 or session manager 145) may dynamically change the routingpath of service layer session messages. For example, if the single-hopsession between session manager 141 and session manager 145 breaks down,then the upstream session manager, which is session manager 141 in thiscase, may recover by establishing a new single-hop service layer sessionwith another neighboring session manager (if available) that happens tohave an established single-hop session with the targeted sessionendpoint (e.g., session endpoint 148). See below for further details onE2E M2M service layer session routing. In addition, although not shownin FIG. 6(see FIG. 3), an alternative to session endpoints and sessionmanagers authenticating with one another is for them to authenticatedirectly with a session credential function in the network instead. Atrusted session credential function could be a central node in thenetwork in which session endpoints and session managers can authenticatewith. By doing this they can be authenticated by this function ratherthan by each other.

Tear-down of a service layer session may work in a similar fashion byremoving service layer session state information on the sessionendpoints and session managers. During a tear down of the service layersession, service layer session state information may be deleted startingat the target session endpoint towards the initiating session endpoint,which also removes service layer session state information on eachsession manager. It is understood that the entities performing the stepsillustrated in FIG. 6 are logical entities that may be implemented inthe form of software (i.e., computer-executable instructions) stored ina memory of, and executing on a processor of, a network node or computersystem such as those illustrated in FIG. 37C or FIG. 37D. That is, themethod(s) illustrated in FIG. 6 may be implemented in the form ofsoftware (i.e., computer-executable instructions) stored in a memory ofa network node, such as the node or computer system illustrated in FIG.37C or FIG. 37D, which computer executable instructions, when executedby a processor of the node, perform the steps illustrated in FIG. 6.

Discussed here are more details with regard to E2E M2M service layersession routing (session routing), as also shown in the functionalarchitecture of FIG. 5. FIG. 7 illustrates an exemplary single servicelayer session between two session endpoints that has multiple servicelayer session routes between the service layer session endpoints.

Each E2E M2M service layer session route may consist of a differentseries of single-hop M2M service layer sessions, which interconnect theM2M session endpoints and M2M session managers with one another. FIG. 7illustrates one service layer session that may take multiple routes,such as route 257 (i.e., solid line) or route 259 (i.e., dotted lines).Multiple service layer session routes between session endpoint 250 andsession endpoint 252 may provide redundancy, fault protection, and evendifferent levels of quality of service. Session manager 251, sessionmanager 253, and session manager 255 may support an E2E M2M servicelayer session routing function (session routing function) to routemessages associated with the designated service layer session to one ofmultiple supported session routes. The session routing function maysupport context awareness as well as policy based routing. For example,the session routing function of session manager 255 may load balance adesignated service layer session across different session paths bykeeping a history of past messages and the routes chosen for thesemessages. The session routing function of session manager 255 may adaptservice layer routes based on loading conditions or faults, which mayprovide better resiliency and QoS. The session routing function maysupport interfacing with underlying access networks to shareinformation, such that the information may be taken into account forservice layer routing decisions as well as underlying access networkrouting decisions.

Another form of session routing that may be supported is routing betweenmultiple underlying transport sessions or access network connectionsthat may be associated with a service layer session. To support this,service layer session manager 255 may have an interface to underlyingtransport/access network routing functions. For example, an M2M deviceor M2M gateway may support multiple radio access technologies (e.g.,Wi-Fi, Cellular, etc.). An E2E service layer session may be layeredover top of multiple single hop M2M service layer sessions. Each singlehop service layer session may have multiple underlying transport oraccess network connections associated with it. Service layer sessionmanager 255 may collaborate with underlying transport or access networkrouting functions to manage the routing and selection of the underlyingtransport or access network connection to use on a single-hop bysingle-hop basis.

With continued reference to FIG. 7, alternatively, a service layer maycollaborate with underlying network routing functions to manage therouting and selection of which underlying transport or access networkconnection to use on an E2E basis. In doing so, security and QoS may bemanaged in an E2E fashion rather than just on a hop-by-hop basis. Forexample, this E2E management may be performed by distributing routingpolicies from the session manager (e.g., session manager 255)responsible for establishing the service layer session to the rest ofthe session managers (e.g., session manager 251 and session manager 253)associated with the designated service layer session. E2E managementenables routing optimizations that may be challenging to support withsingle-hop routing. For example, if the device hosting the sessionendpoint 250 comes into close proximity to the device hosting thesession endpoint 252, then E2E routing optimizations may be dynamicallyperformed. In another example, instead of routing service layer sessionmessages from one application to another application through both an M2Mserver and M2M gateway, E2E routing optimization may be performed tooptimize an E2E route by routing the service layer session messagesthrough a shared M2M gateway in close proximity to both applications oreven establish a direct peer-to-peer route between the applications.

Below are further details with regard to the functional architecture asshown in FIG. 5. The functional architecture may be implemented on asingle device or distributed across multiple devices. E2E M2M servicelayer session context and history function (session context function)161, shown in FIG. 5, may collect, interpret, share, and process E2E M2Mservice layer session context and history information. Session managersand session endpoints may leverage session context information to makecontext aware decisions with regards to the use and management ofservice layer sessions. In addition, session context information may beleveraged for purposes such as billing and charging, as well as historyand tracking. The session context function 161 also supports sharing ofsession context information between sessions managers and/or endpoints.

Some forms of E2E M2M service layer session context information mayinclude one or more of the following: 1) past service layer sessionrouting decisions; 2) dynamically changing cost or pricing informationrelated to service layer sessions and the underlying transport andaccess network connections that are leveraged; 3) location of M2Mdevices and gateways associated with service layer sessions; 4) accessnetwork congestion information and available bandwidth for accessnetwork connections associated with service layer sessions; and 5)availability of M2M devices and gateways associated with a designatedservice layer session (e.g., whether or not an M2M device or gateway issleeping or not)

Some context aware service layer session related decisions may includeone or more of the following: 1) context aware session routing; 2)context aware service layer session load balancing; 3) context awareservice layer session store and forwarding of messages (e.g., whilesession endpoints are unavailable); and 4) context aware service layersession proactive pre-fetching and caching of data from sessionendpoints and caching it within the service layer for more efficientaccess.

FIG. 5 also shows an E2E M2M service layer session policy function(session policy function) 164. Session policy function 164 supportssession policy configuration, management, and sharing. With the use ofservice layer session policies, session managers may more intelligentlymanage service layer session communication between session endpoints. Inaddition, session policy function 164 supports sharing of service layersession policies between session managers or session endpoints. Someservice layer session policies may include, one or more of thefollowing: 1) session routing policies; 2) E2E M2M service layer sessionstore-and-forward policies; 3) service layer session pre-fetch policies;4) service layer session establishment policies; 5) service layersession tear-down policies; 6) session context policies that determinethe context to collect, how to interpret context, how to factor contextinto decision making, etc.; and 7) service layer session securitypolicies that may control authorization and access controls toinformation associated with session.

FIG. 5 also shows an E2E M2M service layer session configuration anddiscovery function 165 (session configuration) supports configurationand discovery capabilities for E2E M2M service layer session attributesand parameters. Configuration of service layer session attributes andparameters may be used to control and customize a service layer sessionduring establishment as well as during normal service layer sessionoperation. Discovery of service layer session state information may beused to find available service layer sessions based on a desired set ofcriteria. This may help M2M applications and M2M service layer instancesfind existing service layer sessions already in progress or candidatesthat support service layer sessions along with corresponding sessioncriteria or attributes. Some types of E2E M2M service layer sessionconfiguration and discovery may include one or more of the following: 1)configuration of service layer session state hosted on a sessionendpoint by a session manager and vice versa; 2) configuration ofservice layer session state hosted on a session manager by anothersession manager; 3) discovery of service layer session state hosted on asession manager by a session endpoint and vice versa; and 4) discoveryof service layer session state hosted on session manager by anothersession manager.

FIG. 5 also shows an E2E M2M session data management function 166(session data management function) that may support management of datacontained within service layer session messages that are processed by aservice layer instance. Leveraging session credentials that have beenbootstrapped into the service layer instance, this function supportsdecryption of data contained within received service layer sessionmessages and encryption of service layer session data that is containedwithin service layer session messages forwarded to service layerinstances and applications. Once the data is decrypted, this functionsupports interfacing and passing this data to other functions in theservice layer instance such as data analytics function, data aggregationfunction, or data mash-ups, among other things. Supporting these typesof functions on intermediate M2M service layer instances enables theseservice layer instances to support value-add data services on messagesflowing through the network, which may make the network more efficientand help reduce the complexity of session endpoint applications as well.

FIG. 5 also shows an E2E M2M session state 151 (session state) which mayinclude one or more of the following: E2E M2M service layer sessionidentifier (session identifier), E2E M2M service layer session securitycredentials (session security credentials), E2E M2M service layersession descriptor (session descriptor), E2E M2M service layer sessionrouting information (session routing information), E2E M2M service layersession context or history (session context), and E2E M2M service layersession policies (session policies). A session identifier may be used bya session manager and session clients (e.g., session applications orservice layer instances) to identify a service layer session. Thesession identifier may be an arbitrary and unique alpha-numeric stringthat can optionally be hashed using session credentials such that it canonly be encrypted/de-encrypted by its corresponding session managers,session endpoints, and session credential function.

A session identifier may also be a descriptive alpha-numeric string thatis indicative of the corresponding session type and/or the functionalityassociated with the session. This descriptive session identifier may beused for session discovery purposes and facilitate sharing of sessioninfo (for example, sensor 123-Measurements, LightingABC-Control, etc.).The descriptive session identifier may help support dynamic formation ofgroup sessions, as well. The descriptive session identifier may beoptionally hashed using session credentials such that descriptivesession identifier can only be encrypted/decrypted by its correspondingsession managers, session endpoints, and session credential function.

A session identifier may recycle portions of other identifiers. Sessionendpoints typically support a unique identifier that is assigned tothem. For example, an M2M application is allocated a unique applicationidentifier when registering to an M2M service layer instance. Similarlyan M2M service layer instance is either provisioned with a uniqueidentifier or dynamically configured with one during a bootstrappingprocedure. These unique identifiers may be used to create E2E M2Mservice layer session identifiers. Session endpoints may exchange uniqueidentifiers with one another during session establishment and theseunique identifiers may be concatenated to form a unique sessionidentifier between the two session endpoints.

Session state may include security credentials associated with servicelayer sessions (for example, E2E security certificates, public keys,etc.) A service layer session may support an independent set ofcredentials (e.g., established and distributed by E2E M2M service layersession credential function) or it may optionally leverage securitycredentials from underlying sessions or connections. For example,security credentials from underlying single-hop M2M service layersessions, transport layer sessions, and/or access network connectionsmay be leveraged.

Session state may include a session descriptor, which is informationdescribing the session that may be used by existing session participants(e.g., session endpoints, session managers, or session credentialfunction) or by prospective session participants to discover an existingservice layer session. A session descriptor may be a description foreach session participant (e.g. device identifiers, type of participant,services that participant supports, interface requirements ofparticipant, type of compression used, etc.). A session descriptor maybe description of each underlying single-hop session that is used toconstruct the service layer session (e.g., information regarding theindividual single-hop M2M service layer sessions making up the multi-hopE2E M2M service layer session, information regarding underlyingtransport or access network connections, etc.).

Session state may include routing information. The session routinginformation may describe the next hop E2E M2M service layer sessionendpoint or session manager to route incoming session messages to. Thefollowing are forms of routing information that may be stored as asession state: a session identifier of an M2M application or M2M servicelayer instance; a single-hop M2M service layer session identifier; anapplication protocol identifier (e.g. a Uniform Resource Identifier(URI), Uniform Resource Locator (URL), Uniform Resource Name (URN),etc.); a transport layer session identifier (TLS session identifier); anetwork layer address (e.g. IP address); an access network identifier(e.g. International Mobile Subscriber Identity (IMSI), Mobile SubscriberIntegrated Services Digital Network-Number (MSISDN), media accesscontrol (MAC) Address, etc.); or a list of available underlying networkinterfaces, access network connections/bearers, transport layerconnections, etc.

Session state may include E2E M2M Service Layer Session Context/History,which may be context information related to and/or history of pastservice layer transactions performed using a service layer session.Examples include keeping track of the type, number, rate, size, etc. ofresources targeted by the session endpoints or keeping track of thedifferent service layer sessions that an application establishes (e.g.rate, type, etc.).

Session state may also include session policies that define rules forhow an E2E M2M service layer session manager or endpoint generates orprocesses E2E M2M service layer session messages. For example, policiesmay include service layer QoS policies routing policies, service layerstore-and-forward policies, service layer access control policies, etc.Policies may also be used to define how a session manager processes thedata associated with a message (e.g., if the data is read-only or if thedata can be aggregated with other data, etc.). Policies may also be usedto define service layer routing rules for a session manager (e.g., somesession must be routed through a specified session manager so thatsession manager can perform such functions as charging, security,tracking/inspection, etc.).

One or more of the following can maintain the disclosed session state: asession manager, a session endpoint, or a session credential function.The session state may be used for the setup, management, and tear downof service layer sessions. Session state may be dynamically created. Forexample, session identifiers may be included in each message tocorrelate the message with a particular service layer session. Sessionendpoints or session managers may create and store session state basedon message they send or receive and index this state based on thesession identifier. A service layer session manager, for example, maystore this state and factor it into future proactive or autonomousservice layer decisions that it makes such as session routing decisions,session store-and-forward decisions, or autonomous service layer actionssuch as pre-fetching of data based on prior history, patterns, ortrends.

A session endpoint may store session state in order to maintain aservice layer session with a session manager. Session state may also beshared between session managers and/or endpoints. This session state maybe maintained by the session endpoint itself or maintained by thesession manager in a manner similar to Web Cookies. For example, sessionstate may be updated/maintained on a session endpoint by a sessionmanager while the endpoint is using the service layer session. In doingso, the session manager may store session state onto the sessionendpoint as an M2M session cookie. When the session endpoint uses thesession in the future, this stored M2M session cookie can be sent to thesession manager or retrieved by it and used by the session manager forawareness of the endpoint's prior activity. An M2M session cookie caninclude session state such as which specific resources an endpointtargeted in the past, the rate at which the resources were targeted,etc. Using this M2M session cookie, the session manager can moreefficiently and proactively manage the current session transactionsbased on prior session activity of the endpoint. For example, thesession manager can proactively trigger devices in advance to ensurethey are awake, proactively reserve access network resources in advance,perform prefetching of targeted resources in advance such that they arecached/buffered in the service layer in advance, etc. Note the disclosedM2M session cookie concept may also be applicable to single-hop M2Mservice layer sessions, as well as E2E M2M service layer sessions.

FIG. 8 illustrates a functional architecture for a session endpoint 260.As shown in FIG. 8, session endpoint 260 may include one or more of thefollowing: an E2E M2M session credential bootstrapping function 261, anE2E M2M session context and history function 262, an E2E M2M sessionestablishment and teardown function 264, an E2E M2M session policyfunction 265, an E2E M2M session configuration and discovery function266, an E2E M2M session data management function 263, and an E2E M2Msession state 267. Session endpoint 260 may be considered a logicalentity that can be the source or sink of E2E M2M service layer sessioncommunication (service layer session communication). In general, sessionendpoint 260 has many of the same functions of the service layer sessionmanager shown in FIG. 5. However in the case of the session endpoint 260of FIG. 8, these functions may be streamlined and support a more limitedset of functionality, particularly for session endpoints that reside ona resource constrained device, such as a thermostat.

With continued reference to FIG. 8, E2E M2M service layer sessionendpoint credential bootstrapping function 261 (session endpointcredential bootstrapping function) supports initiating E2E M2M servicelayer session bootstrap requests to a session manager and receivingcorresponding responses containing session credentials. Thisfunctionality is used by service layer session endpoints that arelooking to establish a service layer session with one or more targetsession endpoints. This disclosed function also supports receiving abootstrap configuration request containing session credentials from asession manager when session endpoint 260 is a target of a session beinginitiated by another endpoint.

E2E M2M service layer session endpoint establishment and tear-downfunction 264 (session endpoint establishment function) supportsinitiating session endpoint establishment requests to a session manager.This function also supports receiving session establishment requestsfrom a session manager when session endpoint 260 is a target of thesession establishment or tear-down.

E2E M2M service layer session endpoint context and history function 262(session endpoint context function) supports collecting, interpreting,and processing of E2E M2M service layer session context and historyinformation in a similar manner as the corresponding function supportedby a session manager as described above. Here, session endpoint 260 maynot support context pertaining to routing and access networkconnectivity. These types of context may be better suited for sessionmanagers.

E2E M2M service layer session endpoint policy function 265 (sessionendpoint policy function) of FIG. 8, supports collecting, interpreting,and processing of E2E M2M service layer session policies in a similarmanner as the corresponding function supported by a session manager asdescribed with regard to the session managers herein. Here, sessionendpoint 260 may not support policies pertaining to routing,store-and-forwarding, pre-fetching, and access network connectivity.These types of context may be better suited for session managers. E2EM2M service layer session endpoint configuration and discovery function266 (session endpoint configuration) supports configuration anddiscovery capabilities for service layer session attributes andparameters in a similar manner as the corresponding function supportedby a session manager as described herein. E2E M2M session endpoint datamanagement function 263 (session endpoint data management function)supports management of data that is contained within E2E M2M servicelayer session messages that are processed by session endpoint 260. Inparticular, this function may support the encryption or decryption ofservice layer session data using the session credentials.

The E2E M2M service layer session interface messages defined herein maybe bound or layered on top of (i.e., encapsulated within) severalunderlying existing protocols such as transmission control protocol(TCP) and/or transport layer security (TLS) session, user datagramprotocol (UDP)/datagram TLS (DTLS), hypertext transfer protocol (HTTP),constrained application protocol (CoAP). In doing so, session state canbe shared and leveraged between the different sessions (e.g. securitycredentials, congestion information, etc.). In addition, a service layersession can support persistency with regards to lower layer sessionssuch that the service layer session can persist and be maintainedindependent of lower layer sessions being setup and torn-down. As oneexemplary embodiment, E2E M2M service layer session control messages canbe encoded as JSON or XML representations and carried within the payloadof HTTP or CoAP messages. These HTTP and CoAP messages can in turn beencapsulated and carried by underlying TCP/TLS and UDP/DTLS messages,respectively.

FIG. 9-FIG. 24 below, provide details with regards to E2E M2M servicelayer sessions that may apply to oneM2M and other architectures. Foradditional context, according to the oneM2M RESTful architecture,capability service functions (CSFs) are represented as a set of“resources.” A resource is a uniquely addressable entity in thearchitecture. A resource has a representation that may be manipulatedvia RESTful methods such as Create, Retrieve, Update, and Delete and isaddressed using a Universal Resource Identifier (URI). A resource maycontain child resource(s) and attribute(s). A child resource is aresource that has a containment relationship with a parent resource. Theparent resource representation contains references to its childresources(s). The lifetime of a child-resource is limited by theparent's resource lifetime. Each resource supports a set of “attributes”that store information of the resource.

FIG. 9 illustrates a oneM2M embodiment of a session manager. oneM2M hasdefinitions of capabilities supported by the oneM2M service layer. Thesecapabilities may be referred to as capability service functions (CSFs),such as CSF 270. The oneM2M service layer is referred to as a capabilityservices entity (CSE), such as CSE 271. The current version of the CSEhas a placeholder for a Session Management (SMG) CSF; however, thedetails of this function have yet to be defined. In an embodiment, asession manager may serve as a oneM2M SMG CSF 272. SMG CSF 272 maymanage service layer sessions between M2M Applications, between an M2MApplication and a CSE, or between CSEs. AEs connect to CSEs viareference point X, while CSEs connect to other CSEs via reference pointY.

FIG. 10A and FIG. 10B illustrate an E2E M2M service layer sessionestablishment procedure for a oneM2M session management (SMG) servicesupporting the resources that are defined in more detail below. Theprocedure may be the following (not necessarily in the order shown). Asshown in FIG. 10A, at step 310, CSE 306 and CSE 304 register with oneanother and exchange E2E M2M service session management (sessionmanagement or SMG) capabilities with one another. At step 311, AE 308and AE 302 register to CSE 306 and CSE 304, respectively, and advertisethat they support E2E M2M session based communication (i.e., E2E M2Mservice layer session). oneM2M defines an application entity (AE) as anetwork node (e.g., M2M device) hosting an M2M application function. Atstep 312, AE 302 subscribes to the sessions collection resource hostedon CSE 304. Included in the subscription request may be a callbackuniform resource identifier (URI) which notifications may be sent to.This may be done for the AE 302 to receive notifications when an M2Mservice session establishment request is received by CSE 304. This maybe done via a CREATE request.

With continued reference to FIG. 10A, at step 313, CSE 304 creates asubscription to the sessions resource for AE 302. At step 314, CSE 304return a positive response to the subscription CREATE request. At step315, AE 308 discovers AE 302 and the capability of AE 302 to support E2EM2M session-based communication (i.e., E2E M2M service layer session).Step 315 may be based on a resource discovery request serviced by CSE306 or CSE 304. Discovery results may include information such as theM2M identifiers (e.g., application ID, node ID, etc.) for AE 302, whichAE 308 may use to establish an E2E M2M session with AE 302. At step 316,AE 308 requests to establish an E2E M2M session with AE 302 by sending a<session> resource CREATE request to CSE 306 that includes AE 302identifier information as well as AE 308 information that is used by theSMG CSF to establish the session. At step 317, CSE 306 allocates aunique E2E session identifier and session credentials. Sessionidentifiers identify the session while session credentials are used toauthenticate and give authorization to participate in the identifiedsession. At step 318, CSE 306 forwards the session establishment requestof step 316 to the next hop (which is CSE 304 in this example). Thesession identifier and session credentials may be included in thisforwarded request. At step 319, SMG CSF on CSE 304 receives andprocesses M2M service session establishment request targeting AE 302.

As continued in FIG. 10B, at step 320, SMG CSF on CSE 304 sends anotification of the M2M service session establishment request to AE 302.CSE 304 includes the session identifier and credentials as well as AE308 session information in the notification such as AE 308's M2Midentifier(s), among other things. This information may be used later byAE 302 to send or receive session-based messages to or from AE 308 viathe SMG CSFs on CSE 304 and CSE 306. At step 321, AE 302 returns apositive response to the notification request indicating that it isinterested and willing to enter into an M2M service session (i.e., E2EM2M service layer session described above) with AE 308. Included in theresponse may be session establishment information specified by AE 302(e.g. AE 302's M2M identifier, resources that it wants to makeaccessible via the session, etc.). At step 322, the SMG CSF on CSE 304creates an M2M service <session> resource and <sessionEndpoint>resources for both AE 308 and AE 302 in which it stores sessioninformation (e.g. sessionID, endpoint identifiers, etc.). In addition, a<nextHop> resource is also created for CSE 306.

With continued reference to FIG. 10B, at step 323, the SMG CSF on CSE304 returns a positive response to the M2M service session establishmentCREATE request to the SMG CSF on CSE 306. At step 324, the SMG CSF onCSE 306 creates M2M <session> resource and <sessionEndpoint> resourcesfor both AE 308 and AE 302 in which it stores session information (e.g.sessionID, endpoint identifiers, etc.). In addition, a <nextHop>resource is also created for CSE 304. At step 325, SMG CSF on CSE 306returns a positive response to M2M service session establishment CREATErequest of step 316 to AE 308. The response may include sessioninformation such as session ID and credentials, among other things. Atstep 326, AE 308 sends a request to CSE 306 to create a session policyto support a desired level of QoS that it requires for the session(e.g., QoS may be that the message should not be store-and-forwarded).At step 327, SMG CSF on CSE 306 forwards request to next hop SMG CSF onCSE 304. At step 328, SMG CSF on CSE 304 creates <sessionPolicy>resource. At step 329, SMG CSF on CSE 304 returns a positive response toSMG CSF on CSE 306. At step 330, SMG CSF on CSE 306 creates<sessionPolicy> resource. At step 331, SMG CSF on CSE 304 returns apositive response to AE 308.

FIG. 11A and FIG. 11B illustrate a session usage procedure for a oneM2MSMG service supporting the resources that are defined in more detailbelow. At step 340, AE 308 sends a service session-based request to CSE306 to update an AE 302 container resource hosted on CSE 304. At step341, CSE 306 detects that the request of step 340 is service sessionbased and passes it to SMG CSF to process. At step 342, based onsessionID, SMG CSF on CSE 306 verifies that a received URI targets avalid session endpoint (AE 302's containerl resource). At step 343,based on a targeted session endpoint (i.e., AE 302), SMG CSF on CSE 306determines next hop is CSE 304. At step 344, based on sessionID andtargeted session endpoint (i.e., AE 302), SMG CSF on CSE 306 findssession policy defining store-and-forward scheduling policy. At step345, based on policy, CSE 306 stores request until off-peak hours andthen forwards it to CSE 304 during off-peak hours. At step 346, CSE 306forwards request to CSE 304. At step 347, CSE 304 detects request issession based and passes it to SMG CSF to process. At step 348, based onsessionID, SMG CSF on CSE 304 verifies a received URI targets a validsession endpoint (AE 302's containerl resource). At step 349, based ontargeted session endpoint, SMG CSF on CSE 304 determines request targetslocal AE 302 container resource. At step 350, based on sessionID andtargeted session endpoint, SMG CSF on CSE 304 finds session policy thatrequires immediate response. At step 351, based on policies, CSE 304services request and returns a response. At step 352, SMG CSF on CSE 304creates session context to keep track of session request/responsehistory.

As continued in FIG. 11B, at step 353, CSE 304 sends a response to CSE306. At step 354, SMG CSF on CSE 306 creates session context to keeptrack of session request/response history. At step 355, SMG CSF on CSE306 sends response to AE 308. At step 356, SMG CSF on CSE 304 prepares anotification to session endpoint (AE 302) that container was updated. Atstep 357, SMG CSF on CSE 304 sends notification to AE 302 thatcontainerl resource was updated as part of the session. At step 358, AE302 responds with a positive response that it received the notification.At step 359, AE 302 sends a session-based RETRIEVE request to CSE 304 toretrieve updated container resource. At step 360, CSE 304 detects thatthe request of step 359 is session based and passes it to SMG CSF toprocess. At step 361, Based on sessionID, SMG CSF on CSE 304 verifiesURI targets a valid session endpoint (AE 302's containerl resource). Atstep 362, Based on targeted session endpoint, SMG CSF on CSE 304determines that the request targets local AE 302 containerl resource. Atstep 363, based on sessionID and targeted session endpoint, SMG CSF onCSE 304 finds session policy that requires immediate response. At step364, based on policies, CSE services request and returns immediateresponse. At step 365, SMG CSF on CSE 304 creates session context tokeep track of session request or response history. At step 366, CSE 304returns response to AE 302.

FIG. 12 illustrates an exemplary E2E M2M session termination procedurefor a oneM2M SMG service supporting the resources defined below. In thisexample, the session termination is invoked by the session initiator (AE308). Although not shown in FIG. 12, session termination may also beinvoked by other session endpoints, the SMG CSF itself, and other CSFshaving proper management rights to do so. At step 370, AE 308 sends anE2E M2M session termination request to CSE 306 using a DELETE.

At step 371 SMG CSF on CSE 306 processes request and determines whichnext hop SMG CSFs on other CSEs it needs to forward session terminationrequest to such that session state on these CSEs can be torn-down. Inthis example, SMG CSF on CSE 304 is the next hop detected. At step 372,SMG CSF on CSE 306 forwards session termination request to SMG CSF onCSE 304. At step 373, a CSF on CSE 304 notifies session endpoint (i.e.,AE 302) that session is being terminated. At step 374, AE 302 processesnotification and deletes locally stored M2M session state. At step 375,AE 302 returns a positive response to the notification requestindicating it has removed its local M2M session state. At step 376, SMGCSF on CSE 304 deletes its locally hosted <session> resource and allchild resources. The SMG CSF also deletes any local session state suchas security credentials and identifiers allocated to the session. Atstep 377, SMG CSF on CSE 304 returns a positive response to the sessiontermination DELETE request to the SMG CSF on CSE 306. At step 378, SMGCSF on CSE 306 deletes its locally hosted <session> resource and allchild resources. The SMG CSF also deletes any local session state suchas security credentials and identifiers allocated to the session. Atstep 379, SMG CSF on CSE 306 returns a positive response to the M2Mservice session termination DELETE request to AE 308. At step 380, AE308 deletes stored M2M session state.

It is understood that the entities performing the steps illustrated inFIG. 10A, FIG. 10B, FIG. 11A, FIG. 11B, and FIG. 12 are logical entitiesthat may be implemented in the form of software (i.e.,computer-executable instructions) stored in a memory of, and executingon a processor of, a network node or computer system such as thoseillustrated in FIG. 37C or FIG. 37D. That is, the method(s) illustratedin FIG. 10A, FIG. 10B, FIG. 11A, FIG. 11B, and FIG. 12 may beimplemented in the form of software (i.e., computer-executableinstructions) stored in a memory of a node or computer systemillustrated in FIG. 37C or FIG. 37D, which computer executableinstructions, when executed by a processor of the node, perform thesteps illustrated in FIG. 10A, FIG. 10B, FIG. 11A, FIG. 11B, and FIG.12.

Disclosed below are resource structures (e.g., FIG. 14) for the SMG CSF,which may be used in procedures discussed herein. To assist in theunderstanding of the resource figures, the oneM2M defined graphicalrepresentation for describing resource structures is the following: 1)square boxes may be used for resources and child resources; 2) squareboxes with round corners may be used for attributes; 3) parallelogramswith no right angles (e.g., rhomboids) may be used for collection ofresources; 4) the multiplicity of each attribute and child resource isdefined; and 5) resource names delimited with “<” and “>” indicate namesassigned during the creation of the resource.

A “sessions” resource can represent a collection of one or more<session> resources, as shown in FIG. 13. Alternatively, <session>resources can be instantiated independently (i.e., outside of a sessionscollection resource). This sessions resource can be instantiated atvarious levels in the oneM2M CSE resource tree hierarchy. The level ofinstantiation can be indicative of the type of M2M session. Similarly,M2M sessions between M2M applications or between M2M applications andCSEs can be instantiated under an application resource as shown in FIG.14. For example, M2M sessions between multiple CSEs may be instantiatedunder a CSE's base URI, as shown in FIG. 15. The sessions resource maycontain child resources according to their multiplicity in Table 1. Thisresource can contain the attributes according to their multiplicity inTable 2.

TABLE 1 Child Resources of sessions Resource Child Resource ChildResource Multi- Name Type plicity Description <session> M2M service nM2M service session re- session sources support attributes resource andchild resources used by the SMG CSF to manage M2M service sessions.subscriptions Collection of 0 . . . 1 Used to create subscriptionssubscription to sessions collection. resources

TABLE 2 Attributes of sessions Resource Multi- Attribute Name plicityDescription creationTime 1 Time of creation of the resourceaccessRightID 0 . . . n URI of an access rights resourcelastModifiedTime 1 Last modification time of a resource

A <session> resource can contain information used by the SMG CSF formanaging a particular M2M service session, as shown in FIG. 16. Thisresource can contain the child resources according to their multiplicityin Table 3. This resource can contain the attributes according to theirmultiplicity in Table 4.

TABLE 3 Child Resources of <session> Resource Child Resource ChildResource Multi- Name Type plicity Description sessionEndpointsCollection of 1 Collection of M2M service session <sessionEndpoint>endpoint resources that support resources endpoint specific attributessessionPolicies Collection of 0 . . . 1 Collection of M2M servicesession <sessionPolicy> policy resources that are used by resources theSMG to manage the M2M service session in a policy based mannersessionContext Collection of 0 . . . 1 Collection of M2M service session<sessionContextInstance> context instance resources which resourcesstore context information related to M2M service session activity andevents. subscriptions Collection of 0 . . . 1 Used to createsubscriptions to a subscription <session> resource. Subscriptionsresources can be used to subscribe to session related events such asadditions or updates to session endpoint context.

TABLE 4 Attributes of <session> Resource Attribute Name MultiplicityDescription sessionID 1 A unique ID assigned by SMG CSF when <session>resource is created (i.e., M2M service session is established).sessionMode 1 The mode that the M2M service session is in. Some examplesof different modes include ONLINE and OFFLINE. When a session is in theONLINE mode, session endpoints can communicate with one another in asession-based manner. When a session is in an OFFLINE mode, sessionendpoints will not be able to communicate with one another. The SMG CSFas well as the session endpoints can configure this attribute.sessionDescription 1 Information (e.g. a string) describing the session.This description can be used to discover an existing session via the CSEresource discovery mechanisms (e.g. by perspective session endpoints).allEndpoints 1 Requests targeted towards this attribute URI will beconsidered for forwarding to all the session endpoints by the SMG CSF.Whether or not the request is forwarded to a particular session endpointis determined by the SMG CSF checking the trailing portion of the URIthat follows “allEndpoints”. This portion of the URI path will becompared against each session endpoint's endptPaths attribute. If amatch is found, then the request is forwarded towards the sessionendpoint. Otherwise, the request is not forwarded towards a sessionendpoint. creationTime 1 Time of creation of the resource expirationTime1 Absolute time after which the resource will be deleted by the CSE.This attribute can be provided by the issuer upon resource <session>creation, and in such a case it will be regarded as a hint to thehosting CSE on the lifetime of the resource. expirationTime can beextended by performing an update before expirationTime has elapsed.accessRightID 1 . . . n URI of an access rights resourcelastModifiedTime 1 Last modification time of a resource

The sessionEndpoints resource can represent a collection of<sessionEndpoint> resources, as shown in FIG. 17. This resource cancontain the child resources according to their multiplicity in Table 5.This resource can contain the attributes according to their multiplicityin Table 6.

TABLE 5 Child Resources of sessionEndpoints Resource Child ResourceChild Resource Multi- Name Type plicity Description <sessionEndpoint>M2M service n M2M service session session endpoint resources thatendpoint support attributes used resource by the SMG CSF to manage M2Mservice sessions. subscriptions Collection of 0 . . . 1 Used to createsubscrip- subscription tions to sessionEndpoints resources collection

TABLE 6 Attributes of sessionEndpoints Resource Multi- Attribute Nameplicity Description creationTime 1 Time of creation of the resourceaccessRightID 0 . . . n URI of an access rights resourcelastModifiedTime 1 Last modification time of a resource

The <sessionEndpoint> resource can contain attributes and childresources applicable to a particular M2M service session endpoint, asshown in FIG. 18. This resource can contain the child resourcesaccording to their multiplicity in Table 7. This resource can containthe attributes according to their multiplicity in Table 8.

TABLE 7 Child Resources of <sessionEndpoint> Resource Child ResourceChild Resource Multi- Name Type plicity Description nextHops Collectionof n M2M service session next hop M2M service resources supportattributes session next used by the SMG CSF to hop resources manage M2Mservice session hops.

TABLE 8 Attributes of <sessionEndpoint> Resource Attribute NameMultiplicity Description endptNodeID 1 Identifier of M2M node (oneM2Mdefined M2M- Node-ID) hosting M2M service session endpoint endptID 1Identifier of M2M service session endpoint. Configured with anapplication identifier (oneM2M defined App-Inst-ID) if session endpointis an M2M Application. Configured with a CSE identifier (oneM2M definedCSE-ID) if session endpoint is a CSE. endptSubID 1 Identifier of M2MService Provider's service subscription (oneM2M defined M2M-Sub-ID)associated with M2M service session endpoint endptPaths 0 . . . n Asession endpoint may publish a set of resource paths to restrict thescope of an M2M service session to a particular set of endpointresources. For example, an M2M service session can be created to onlyallow session-based communication with a subset of resources hosted onan M2M device. When present, a SMG CSF can compare the URI specified insession-based requests against this URI paths specified in thisattribute. If a match is found, then the SMG CSF forwards the requesttowards the session endpoint. Otherwise, the SMG CSF does not. In theabsence of this attribute, the scope of M2M service session endpointshall not be restricted. Note, accessRights take precedence over thisattribute. endptDescription 1 Information describing the sessionendpoint that can be used by perspective session participants todiscover session endpoint via CSE resource discovery mechanismscreationTime 1 Time of creation of the resource accessRightID 0 . . . nURI of an access rights resource. lastModifiedTime 1 Last modificationtime of a resource

The nextHops resource can represent a collection of <nextHop> resources,as shown in FIG. 19. This resource can contain the child resourcesaccording to their multiplicity in Table 9. This resource can containthe attributes according to their multiplicity in Table 10.

TABLE 9 Child Resources of nextHops Resource Child Resource ChildResource Multi- Name Type plicity Description <nextHop> M2M service nM2M service session next hop session next resource that supports attri-hop resource butes used by the SMG CSF to keep track of the next hopused to forward session messages to for a particular session endpoint.

TABLE 10 Attributes of nextHops Resource Multi- Attribute Name plicityDescription creationTime 1 Time of creation of the resourceaccessRightID 0 . . . n URI of an access rights resource.lastModifiedTime 1 Last modification time of a resource

The <nextHop> resource, as shown in FIG. 20, can contain informationregarding the next hop CSE that a SMG CSF forward messages for aspecific session endpoint when the M2M session consists of multiple CSEhops in between session endpoints. This resource can be used by the SMGCSF to maintain state of the next hop CSE which session-based requestsare forwarded for a given session and/or session endpoint. Maintainingthis information can be useful for such operations as tearing downmulti-hop M2M sessions spanning across multiple CSEs as well ascollaboration between SMG CSFs hosted on different CSEs. This resourcecan contain the attributes according to their multiplicity in Table 11.

TABLE 11 Attributes of <nextHop> Resource Attribute Name MultiplicityDescription nextHopNodeID 1 Identifier of a next hop M2M node (oneM2Mdefined M2M-Node-ID) for targeted M2M service session endpoint nextHopID1 Identifier of the next M2M service session hop. Configured with anapplication identifier (oneM2M defined App-Inst-ID) if next hop is anM2M Application. Configured with a CSE identifier (oneM2M definedCSE-ID) if next hop is a CSE. nextHopSubID 1 Identifier of M2M ServiceProvider's service subscription (oneM2M defined M2M-Sub-ID) associatedwith M2M service session next hop. nextHopDescription 1 Informationdescribing the session endpoint that can be used by perspective sessionparticipants to discover session endpoint via CSE resource discoverymechanisms nextHopState 0 . . . 1 Indicates if next hop is currentlyreachable or not. Next hop's SMG can set this attribute to OFFLINE orONLINE. Additionally, a CSE can set this attribute to NOT_REACHABLE ifit detects a next hop CSE cannot be reached and ONLINE if it detectsnext hop CSE can be reached. creationTime 1 Time of creation of the M2Mservice session endpoint's next hop resource lastModifiedTime 1 Lastmodification time of M2M service session endpoint's next hop resourceaccessRightID 0 . . . 1 URI of an access rights resource associated withM2M service session endpoint's next hop resource

The sessionPolicies resource can represent a collection of<sessionPolicy> resources, as shown in FIG. 21. This resource cancontain the child resources according to their multiplicity in Table 12.This resource can contain the attributes according to their multiplicityin Table 13.

TABLE 12 Child Resources of sessionPolicies Resource Child ResourceChild Resource Multi- Name Type plicity Description <sessionPolicy> M2Mservice n M2M service session policy session policy resource thatsupports resource policy related attributes subscriptions Collection of0 . . . 1 Used to create subscriptions subscription to sessionPoliciescollec- resources tion.

TABLE 13 Attributes of sessionPolicies Resource Multi- Attribute Nameplicity Description creationTime 1 Time of creation of the resourceaccessRightID 0 . . . n URI of an access rights resource.lastModifiedTime 1 Last modification time of a resource

The <sessionPolicy> resource can contain attributes applicable to aparticular M2M service session policy, as shown in FIG. 22. Thisresource can contain the attributes according to their multiplicity inTable 14.

TABLE 14 Attributes of <sessionPolicy> Resource Multi- Attribute Nameplicity Description policyType 1 The type of policy syntax/language/semantics used to specify the session policy definition. policy 1Session policy definition applicableEndpts 0 . . . 1 List of one or moresession endpoints that this policy is applicable to. If not specified,than policy is applicable to all session endpoints creationTime 1 Timeof creation of the resource accessRightID 0 . . . n URI of an accessrights resource. lastModifiedTime 1 Last modification time of a resource

The sessionContext resource can represent a collection of<sessionContextlnstances> resources, as shown in FIG. 23. This resourcecan contain the child resources according to their multiplicity in Table15. This resource can contain the attributes according to theirmultiplicity in Table 16.

TABLE 15 Child Resources of sessionContext Resource Child Resource ChildResource Multi- Name Type plicity Description <sessionContextInstance>M2M service n M2M service ses- session policy sion context resourceinstance resource that supports context related attributes subscriptionsCollection of 0 . . . 1 Used to create subscription subscriptions toresources sessionContext collection.

TABLE 16 Attributes of sessionContext Resource Multi- Attribute Nameplicity Description creationTime 1 Time of creation of the resourceaccessRightID 0 . . . n URI of an access rights resource.lastModifiedTime 1 Last modification time of a resource

The <sessionContextInstance> resource can contain attributes applicableto a particular type of M2M service session context, as shown in FIG.24. This resource can contain the attributes according to theirmultiplicity in Table 17.

TABLE 17 Attributes of <sessionContextInstance> Resource Attribute NameMultiplicity Description contextType 1 The type of session informationto be collected by the SMG CSF and stored within this session contextinstance (e.g. total number of transactions since session wasestablished, rate of transactions, etc.). container 1 URI of containerresource where information for this session context instance is storedby SMG CSF. Session context Information can be stored within container'scontent instance resources. maxNrContentInstances 1 Maximum number ofcontent instances of designated container resource used by SMG CSF tostore session context information. maxByteSize 1 Maximum number of bytesallocated for designated container resource (across all contentinstances) used by SMG CSF to store session context. maxInstanceAge 1Maximum age of content instances of designated container resource usedby SMG CSF to store session context. applicableEndpts 0 . . . 1 List ofsession endpoints that this context shall be collected for. If notspecified, than context shall be collected for all session endpointscreationTime 1 Time of creation of the resource accessRightID 0 . . . nURI of an access rights resource. Must refer to the access rightresource. lastModifiedTime 1 Last modification time of a resourceService Layer Session Migration and Sharing

To illustrate the need and advantages of service layer session migrationand sharing, two use cases are described herein. The first isillustrated in FIG. 25, and the second is illustrated in FIG. 26.

Referring to FIG. 25, in the first use case, consider a company shipsfresh produce (e.g., bananas) around the world. Depending on theirdestination, a typical journey for the company's produce can varydrastically in distance and can consist of several legs aboard differentforms of transportation including planes, trains (e.g., train 410),trucks (e.g., truck 414), and ships which it contracts. Each of theselegs can have drastically different shipping times. In addition,depending on their destination, the produce can make several stops atdistribution centers, warehouses (e.g., warehouses 402 and 404), loadingdocks, etc. For these reasons, ensuring that properly ripe producesreaches its final destination can be quite challenging for the company.

To ensure the quality and freshness of the produce from a field where itis grown and harvested to a supermarket where it can be purchased, thecompany may use M2M sensor technology to monitor the ripeness of theproduce as well as environmental conditions during transport. Forexample, an M2M sensor, such as sensors 412 a, 412 b, 412 c, and 412 d,may be provided within each box of produce that the company ships.Hosted on each M2M sensor may be an application that takes periodicmeasurements of the produce contained within the box. For example, inthe case of bananas, by measuring an amount of ethylene gas that thebananas in the box emit over time, the M2M sensor may be used to helppredict where in the ripening process the bananas are. This is becausebananas increase their levels of ethylene gas emission as they ripen. Inaddition, the temperature within the box may also be closely monitoredsince the ripening of bananas can be slowed down by lowering theirtemperature and, vice versa, sped up by increasing their temperature.

As a box of produce makes its way to its destination, for example from afirst warehouse 402 to a second warehouse 404, the company may use a M2Mservice layer platform consisting of an M2M server 400 that communicateswith a network of M2M gateways (e.g., M2M gateways 407 and 409)installed along distribution routes (e.g. warehouses, distributioncenters, loading docks, etc.) to collect measurements from each box ofproduce as it travels from stop to stop along its route. As a box ofproduce reaches a new location along its route, the M2M sensor withinthe box (e.g., sensors 412 a-d) may establish a service layer sessionwith the M2M gateway (e.g., M2M gateway 407 or 409) at its new location.

The M2M gateway service layer instance in an M2M gateway mayautomatically identify a given box of produce, where it originated from,its travel history, as well as measurements collected by M2M gatewayservice layer instances at the prior stops along its route. This may allbe facilitated by a session migration feature (described furtherhereinafter) supported by the M2M service layer platform that allowsservice layer session context and configuration information to bemigrated and shared amongst M2M gateway service layer instances (withassistance from the M2M Server) along an M2M sensor's route. Forexample, service layer session context 406 for the service layersessions established between the M2M applications on the sensors 412 a-dand the M2M service layer instance on M2M gateway 407 at a firstwarehouse 402 may be migrated to the M2M service layer instance on M2Mgateway 409 at a second warehouse 404 (with assistance from the M2Mserver 400), as represented by line 418 in FIG. 25. The migrated servicelayer session context is shown at 406, 406′, and 406″ as it istransmitted from the M2M gateway 407, to the M2M server 400, and on tothe M2M gateway 409. In doing so, this session migration feature savesthe M2M application running on each M2M sensor in each box of producefrom having to establish a new M2M service layer session with each M2Mgateway service layer instance along its route. Instead, the migratedsession context may be used to re-establish an existing session whichsaves the M2M sensor from having to configure the session from scratch.In addition, service layer session context collected by each M2M gatewayservice layer instance along the route may be more securely andefficiently shared with other M2M gateway service layer instances alongthe route. This may be done by the service platform automaticallymigrating the context between the M2M gateway service layer instanceswhen detecting the M2M sensor has moved to a new location and registeredto a new M2M gateway service layer instance. This may allow localapplications connected to the new M2M gateway service layer instance(e.g. an instance of the company's management application —not shown) tomore efficiently and easily discover and access this information. As anexample, leveraging this session migration functionality, the rate atwhich each box of produce has been ripening may be more efficiently andaccurately tracked and, in turn, the company may make more informedshipping decisions.

FIG. 26 illustrates another example use case. In this use case, considera person 423 who may be suffering from a mild form of dementia and maybe a type B diabetic. The person may live at home 427 alone, and mayrequire some remote assistance from family and care providers. Toprovide the person with proper care, the home 427 has been equipped withvarious sensors (e.g. sensors for bed mattress, floor, bathroom,kitchen, etc.) to track the person's location in the home as well as theperson's activity level. In addition, the person may be equipped with asmart glucometer device 422 that is worn to monitor the person's glucoselevels. In this example, the sensors (e.g., sensor 422) may beconfigured to report readings on a regular basis to an M2M enabled Webservice platform managed by the person's health care provider. This M2Mservice layer platform may provide services which allow the person'sfamily and care providers to remotely monitor the person using theinformation provided by the sensors in the home.

The M2M service layer platform may allow each of the person's familymembers and care providers to establish a secure communication sessionvia the M2M service layer platform to the sensors in the person's homeand monitor the person's activity using a remote app hosted on one oftheir Web enabled devices (e.g. smart phone, tablet, laptop, etc.). Theplatform may coordinate secure communication between the person'ssensors and each of the apps hosted on the person's family members andcare providers devices. Via the service layer platform, each familymember and care provider may be able to access real-time informationabout the person, such as location in the home. In addition, they canalso access information collected by the sensors and stored within theM2M service layer platform, such as tracked movement throughout thehouse that day, whether the person visited the bathroom, whether theperson opened the refrigerator or turned on the stove, or a collectionof glucometer readings over the past 12 hours, for example. The M2Mservice layer platform may be capable of also allowing the person'sfamily members to subscribe and receive alerts based on the occurrenceof specific events such as when a stove has been left on for over anhour or the glucometer readings have exceeded a certain threshold.

To allow the person's family members and care providers to bettercoordinate with one another and ensure the person is being adequatelymonitored at all times while still allowing family members to enjoy someof their own free time, the service platform may support certainadditional features. One such feature is the ability of the servicelayer platform to allow the family members and care providers to splitthe person's care up into scheduled shifts. At the start/end of eachshift, the service layer may support seamlessly switching the person'smonitoring over from one family member or care provider to another. Thismay be achieved by the service layer platform dynamically migrating theservice layer session connecting the sensors in the home from onedesignated family member or care provider to another.

For example, with reference to FIG. 26, the M2M application running on aremote monitoring device 422, such as a glucometer, may establish aservice layer session with an eHealth application running on a smartphone 428 of one of the person's family members, which session may befacilitated by the service layer instances on M2M gateway 420 and M2Mserver 421, as shown. The M2M gateway 420 may store service layersession context 424 relating to the session, and the service layerinstances running on the M2M server 426 and smart phone 428 may alsostore context relating to the session at 426 and 430, respectively. Atpredetermined or scheduled time, the service layer platform mayfacilitate the migration of the service layer session connecting themonitoring device 422 with the smart phone 428 from that smart phone 428to a laptop 430 of another family member or care provider running itsown instance of the eHealth application. This migration is illustratedby the dashed line 436. As shown, the migrated service layer sessioncontext 430′ may be used to re-establish the existing session at thelaptop 432, allowing the other family member or care taker to take overmonitoring of the person. When performing this migration, the servicelayer may automatically update the contact information where theperson's alerts are sent to, such that at the start/stop of each shift adesignated family member or care provider is configured to receive thesealerts via the secure service layer session that connects their devicesto the person's sensors.

Another feature which the service platform may support is the ability toallow the person's family members and care providers to seamlesslymigrate their service layer session connecting their device to theperson's sensors to another designated device(s)—owned by the samefamily member or care provider. For example, if during that familymember's or caretaker's shift they would like to transition from usingtheir phone to using their tablet or PC to receive alerts, they canswitch over on the fly and the service layer will ensure the servicelayer session is migrated such that none of the alerts are lost and alsothat any past context collected by the sensors is securely and fullyaccessible from the new device as well.

To support use cases such as the example ones illustrated in FIGS. 25and 26, disclosed hereinafter are methods for migration or sharing of anexisting M2M service layer session with one or more prospective sessionparticipants. As used herein, the term “service layer session” andvariations thereof means a stateful and semi-permanent exchange ofinformation between M2M service layer session participants. The term“M2M service layer session participant” and variations thereof refers toan M2M service layer instance or a M2M application instance taking partin a particular M2M service layer session. As further used herein, theterm “M2M service layer session context” and variations thereof meansinformation related to a M2M service layer session which is maintainedby one or more M2M service layer session participants. As also usedherein, the terms “M2M service layer session migration,” “service layersession migration,” “session migration,” “migration,” and the like meanthe act of transferring M2M service layer session context between M2Mservice layer session participants. As used herein, the term “M2Mservice layer session sharing,” “service layer session sharing,”“session sharing,” “sharing,” and the like mean the act of replicatingM2M service layer session context between M2M service layer sessionparticipants and keeping these replicated versions of session contextsynchronized with one another such that participants can share the samesingle session. An “M2M application” refers to an application targetinga particular M2M use case (e.g. eHealth, smart energy, home automation,and the like).

The disclosed methods include determining whether a service layersession is established and if it has session migration or sharingfunctionality enabled or not; allowing session participants (existing orprospective) to configure a session migration and sharing service and toexplicitly trigger this service to start service layer session migrationor sharing; allowing a session migration and sharing service toautonomously trigger the start of service layer session migration orsharing based on a session migration/sharing schedule and/or policies;collecting and maintaining service layer session context which can beused to migrate or share a service layer session; determiningprospective session participants that will be targeted when performingsession migration or sharing; determining whether a prospective sessionparticipant is capable of supporting service layer sessions or not;determining whether an existing session participant isinterested/willing to migrate or share its service layer session;migrating a service layer session by transferring service layer sessioncontext from an existing session participant to a prospective sessionparticipant; sharing a service layer session by making service layersession context from an existing session participant(s) available to aprospective session participant(s); and coordinating migration andsharing of service layer sessions with underlying access networkconnections by sharing service layer session migration and sharinginformation with the underlying access network.

The methods may be performed by and/or implemented in the form of aSession Migration and Sharing Function (SMSF) that may be used toperform the migration or sharing of a M2M service layer session. Variousforms of service layer session context are also described, which may beused to enable the migration and sharing of M2M service layer sessions.Additionally, a oneM2M embodiment of the SMSF is disclosed.

FIG. 27 shows one example of M2M service layer session migration. Inthis example, a M2M service layer session has been established betweenan M2M application 440 of an M2M device 442 (e.g., a sensor) and theservice layer instance 446 of a first M2M gateway 444 (M2M GW #1). Asshown, the service layer instance 448 of the M2M gateway 444 willmaintain service layer session context information 448 relating to thesession. Assume, however, that at Step 1, the M2M device 442 moves andregisters with a second M2M gateway 454 (M2M GW #2). The M2M application440 may trigger re-establishment of the service layer session with thenew M2M gateway 454. As a result, the session may be migrated from theservice layer instance 446 hosted on the first M2M gateway 444 to theservice layer instance 452 hosted on the M2M server 450, and then to theservice layer instance 456 hosted on the second M2M gateway 454. Whenthe migration is complete, the service layer session context 448 resideson the second M2M gateway 454, but not the first M2M gateway 444 nor theM2M server 450. Alternatively, session context could be kept on the M2Mserver 450 to help with future migration requests from other potentialsession participants. Some examples of other potential M2M service layersession migration embodiments (not shown in FIG. 27) include migratingservice layer sessions directly between service layer instances hostedon M2M gateways as well as between service layer instances hosted on M2Mservers and between service layer instances hosted on M2M devices. Inaddition, service layer session migration can also involve migration ofsession context between M2M application instances as well.

FIG. 28 shows one example of M2M service layer session sharing. In thisexample, the service layer instances hosted on M2M server #1 and M2MServer #2 replicate service layer session context between themselves toallow both M2M Web Application #1 and #2 to share a single service layersession with the M2M Application hosted on the M2M Device. In doing so,both can securely communicate with the device's application (e.g. accessits sensor readings and/or control the device) in a coordinated andsynchronized fashion. Such sharing may be well-suited for scenariosinvolving service layer sessions in which M2M applications have a largedegree of separation between each another (e.g. geographically and/orwith respect to number of network hops). In these cases, having servicelayer instances located close to each application can be beneficialversus having the applications communicate with a service layer instancelocated far distances away. This type of sharing may also well suitedfor scenarios where M2M applications are distributed across multipleservice layer instances for purposes such as load balancing. In thesescenarios, sharing service layer sessions across service layer instancescan allow applications to more efficiently participate in the samesession with one another since the service layers can manage andsynchronize service layer session context for the applications and allowthem to communicate with their local service layer instances rather thanhaving to communicate with remote service layer instances. Some examplesof other potential M2M service layer session sharing embodiments (notshown in FIG. 28) include sharing service layer sessions between servicelayer instances hosted on M2M gateways and/or M2M devices. In additionservice layer session sharing can also involve sharing of sessioncontext between M2M application instances as well.

To enable service layer session migration and sharing, a SessionMigration and Sharing Function (SMSF) may be provided that supports, butis not limited to, the following types of functionality: (i) generatingtriggers or accepting triggers for when M2M service layer sessionmigration or sharing is to be performed; (ii) evaluating triggers todetermine if/when to initiate M2M service layer session migration orsharing and the applicable session participants to perform the migrationor sharing on; (iii) performing service layer session migration bytransferring session context between session participants; and (iv)performing service layer session sharing by replicating session contextbetween session participants and keeping the replicated copies ofcontext up to date with one another. In one embodiment, this SMSFfunction may be hosted within a M2M service layer instance hosted by anM2M node, such as an M2M server, M2M gateway, or M2M device, as shown inFIG. 29. For example, the SMSF may comprise an individual servicecapability within the M2M service layer instance or as a sub-functionwithin an existing service capability.

To facilitate the migration and sharing of M2M service layer sessions,service layer session migration and sharing context may be employed,including, but not limited to, one or more of the following types ofcontext (i.e., information) as defined in Table 18. This type of contextcan be used by an SMSF to make a determination (i.e. trigger decision)of whether to perform service layer session migration or sharing, whento perform it, which session to perform it on.

TABLE 18 M2M Service Layer Session Migration and Sharing Context M2MService Layer Session Migration and Sharing Context Description M2MService Layer This schedule may specify information such as set timeswhen an Session Migration and SMSF is to perform session migration orsharing. The schedule can Sharing Schedule also include a list ofsession participants for which an SMSF is to target when performingsession migration or sharing at the specified scheduled times. M2MService Layer These may be policies that define rules for the migrationor sharing of Session Migration and M2M service layer sessions betweenexisting and prospective session Sharing Policies participants. Forexample, these policies may specify rules such as what type of sessioncontext can be migrated or shared with certain session participants,which session participants are permitted to communicate with oneanother, and specific conditions which are to trigger an SMSF to performsession migration or sharing. M2M Service Layer These are events thatmay be used to trigger the migration or sharing of Session Migration ora M2M service layer session. An event may be autonomously Sharing Eventsgenerated and acted upon by an SMSF to initiate session migration orsharing. Alternatively, an event may be explicitly generated by asession participant and then detected by an SMSF to initiate sessionmigration or sharing.

In addition, a second type of service layer session context may also beemployed. This type of context may be configured, collected, stored inmemory, and/or maintained by session participants (e.g. service layerinstances). In turn, this session context may be migrated or sharedbetween session participants via SMSF(s). In this manner, the migrationor sharing of a service layer session can be coordinated and achieved.Some examples of this second type of context include, but are notlimited to, the context defined in Table 19 below. Note that the servicelayer session context listed in Table 19 may be specific to anindividual session participant or it can be applicable to allparticipants of a given service layer session.

TABLE 19 M2M Service Layer Session Context M2M Service Layer SessionContext Description M2M Service Layer Subscription information such asnotification criteria and contact Session participant addresses wherenotifications corresponding to service layer Subscription subscriptionsfrom M2M service layer session participants are to be Information sentto. M2M Service Layer This identifier can be allocated and assignedduring session Session Identifier establishment and then used by sessionparticipants and SMSF to uniquely identify a M2M service layer sessionduring the service layer session migration and sharing methods proposedin this disclosure. The identifier can also be used to tag contextstored within service layer instances or applications such that thecontext can be associated with a corresponding service layer session.Tagging service layer context in this manner can enable the context tobe more easily identified if/when the context is to be migrated orshared. M2M Service Layer Security credentials used by sessionparticipants to securely establish Session participant and use a M2Mservice layer session, control access to session based SecurityCredentials context, and communicate with one another via the session.Some examples can include, security certificates, public keys, accesscontrol lists, etc. M2M Service Layer Charging records that have beengenerated on behalf of M2M service Session Charging layer sessionparticipants and that contain a history of prior session recordsactivity such as number of requests serviced, amount of bandwidthconsumed, notifications generated, etc. M2M Service Layer Informationdescribing the service layer routing information applicable Sessionparticipant to the routing of service layer session messages to therespective Routing Information session participants. M2M Service LayerLocation information such as the current/prior locations of sessionSession participant participants Location M2M Service Layer Datacollected and stored by M2M service layer on behalf of session Sessionparticipant participants during the lifetime of the session. Forexample, application Data data stored within service layer containerresources. M2M Service Layer Discovery information which a sessionparticipant publishes and makes Session participant available to helpfacilitate session migration and sharing. Information DiscoveryInformation can include description of the service layer session thatcan be used by existing session participants or by prospective sessionparticipants to discover an existing session, its participants, thefunctionality supported by its participants, etc. For example, adescription for each session participant (e.g. device identifiers, typeof participant, services that participant supports, interfacerequirements of participant, etc.) M2M Service Layer Information relatedto and/or history of past service layer transactions Session participantperformed using E2E M2M service layer session. For example, TransactionContext keeping track of the type, number, rate, size, etc. of resourcestargeted by the session participants. M2M Service Layer Information suchas session identifiers, policies, context, and Session participantcredentials regarding one or more underlying access network/transportAccess Network/ layer sessions which service layer sessions can belayered over top of. Transport Layer An SMSF can use this information tocoordinate service layer session Session Context sharing and migration.For example, when migrating or sharing a service layer session, an SMSFcan also coordinate with underlying access network nodes to migrate orshare these underlying sessions as well. In doing so, the SMSF cancoordinate not only service layer session migration and sharing but alsounderlying access network session migration and sharing in concert withone another.

FIG. 30 illustrates one embodiment of a method for migration or sharingof an existing M2M service layer session with one or more prospectivesession participants. In one embodiment, this method may be used by anM2M application instance to request that the service layer sessionexisting between itself and a specified service layer instance bemigrated by the SMSF to another service layer instance, for example asshown in FIG. 27. In a second embodiment, this method may be used byeither an M2M application instance or a M2M service layer instance torequest that an existing service layer session be shared by the SMSFwith another service layer instance and one or more of the M2Mapplications registered to it, for example as shown in FIG. 28. In athird embodiment, this method may be used by an M2M application instanceto request that the SMSF share an existing M2M service layer sessionassociated with another M2M application instance with it. In a fourthembodiment, this method may be used by an M2M service layer instance torequest that the SMSF migrate an existing M2M service layer sessionexisting between an M2M application instance and another M2M servicelayer instance with it.

Referring to FIG. 30, in step 1, a M2M service layer session isestablished between two or more session participants. For example, anM2M service layer session may be established in accordance with theexemplary mechanisms illustrated in FIGS. 1-24 and described above.

In step 2, a check may be performed to determine whether the sessionbeing established has session migration or sharing functionality enabledor not. In one embodiment, this check may be performed by a functionwithin an M2M service layer responsible for the establishment of M2Mservice layer sessions. If the results of this check determine thatsession migration or sharing is enabled, then a transition to step 3 mayoccur, otherwise no further processing for session migration or sharingis performed for this service layer session.

Step 3 is an enhancement to session establishment methods. In this step,during service layer session establishment, an SMSF—which as discussedabove functions as a service within an M2M service layer and may residewithin the service layer instance of an M2M server, gateway, device orother node—may be configured with information which can include, but isnot limited to one or more of the following:

-   -   1. A session migration or sharing schedule—this schedule may        specify information such as set times when an SMSF is to perform        session migration or sharing. The schedule may also include a        list of session participants for which an SMSF is to target when        performing session migration or sharing at the specified        scheduled times.    -   2. Session migration or sharing policies—these policies may        specify rules used by the SMSF when performing session migration        or sharing. Policies may specify rules such as what type of        session context can be migrated or shared with certain session        participants, which session participants are permitted to        communicate with one another, and specific conditions which are        to trigger SMSF to perform autonomous.    -   3. Underlying access network/transport layer session        information—this may include information such as session        identifiers, policies, context, and credentials regarding one or        more underlying access network/transport layer sessions which        service layer sessions can be layered over top of An SMSF may        use this information to coordinate service layer session sharing        and migration. For example, when migrating or sharing a service        layer session, an SMSF may also coordinate with underlying        access network nodes to migrate or share corresponding        underlying sessions as well. In doing so, the SMSF may        coordinate not only service layer session migration and sharing        but also underlying access network session migration and sharing        in concert with one another.        Note that this configuration can be done via static or        out-of-band pre-provisioning of an SMSF (e.g. configured when        SMSF is deployed) or via dynamic configuration of an SMSF (e.g.        by a management entity in the network).

In step 4, an SMSF may collect and maintain service layer sessioncontext such as the context described in Table 18 or Table 19 above. AnSMSF may collect and maintain service layer session context usingmethods that may include, but are not limited to, one or more of thefollowing:

-   -   1. M2M service layer session participants may explicitly pass        session context to an SMSF via an SMSF supported interface. For        example in an RoA embodiment, an SMSF can support session        context resources which session participants can perform CRUD        operations to. In a SoA embodiment, an SMSF can support session        context functions which can be called by session participants to        pass in session context.    -   2. An SMSF may support a mechanism for pro-actively collecting        service layer session context from M2M service layer session        participants. For example, in one embodiment an SMSF may query        service layer instances to collect session related context from        the individual service capabilities supported by the service        layer (e.g. collect session context such as that defined in        Table 18 or 19).

In step 5, an SMSF may detect a trigger condition that it needs toperform M2M service layer session migration or sharing. This triggercondition may either be autonomously generated or may be the result ofreceiving an explicit request from an existing or prospective servicelayer session participant. An SMSF may detect service layer sessionmigration or sharing triggers using methods that may include, but arenot limited to, one or more of the following:

-   -   1. An SMSF may autonomously determine that it needs to trigger        migration or sharing of a particular M2M service layer session        from one or more existing session participants to one or more        prospective session participants. This determination may be        based on conditions which can include, but are not limited to,        one or more of the following:        -   a. An SMSF may use a schedule to coordinate session            migration or sharing. This proposed schedule is described in            step 1 above.        -   b. An SMSF may use a combination of service layer session            policies (see step 1) and context (see step 2) to determine            if/when session migration or sharing is required.    -   2. Alternatively, an existing M2M service layer session        participant may determine that it needs to migrate or share its        M2M service layer session with one or more other prospective        session participants and as a result, it may generate an        explicit trigger to an SMSF. This determination can be based on        conditions which can include, but are not limited to, one or        more of the following:        -   a. A session participant may detect that either itself or            one of the other existing session participants has changed            locations or is planning on changing locations. Where            location can be in terms of, but is not limited to, absolute            location (e.g. geo-location) or relative location (e.g.            network domain).        -   b. A session participant may detect the presence of new            candidate session participants in its vicinity (i.e. other            M2M service layer instances or application instances) that            may be willing to participate in the service layer session.        -   c. A session participant may detect the presence of a more            suitable candidate session participant than the session            participants it is currently communicating with. For            example, a session participant can detect that either itself            or one of the other existing session participants has            registered to another service layer instance and this new            service layer instance can serve as a superior session            partner (e.g. the new service layer instance is closer, or            supports more session-based features, or new service layer            instance has applications registered to it which a session            participant is interested in communicating with, etc.).        -   d. A session participant may detect that either itself or            one of the other existing session participants has become            overloaded and is no longer able to effectively participate            in the session.        -   e. A session participant can detect that one of the other            existing session participants is no longer available (e.g.            has left the network, has lost connectivity, has gone to            sleep, etc.).        -   f. A session participant can detect that it is going to be            unavailable in the near future (e.g. it is going offline or            going to sleep, etc.).    -   3. Alternatively, a prospective M2M service layer session        participant may determine that it would like to have a M2M        service layer session migrated or shared with it and as a result        it can trigger an SMSF to perform this migration/sharing. This        determination may be made by the prospective session participant        querying an SMSF and detecting the presence of service layer        sessions in its vicinity that may be willing to migrate or share        their service layer session with it. In addition, an SMSF may        also provide a description of each session, such that the        prospective participant can determine which sessions it is        interested in or compatible with. Based off of this information        a prospective session participant can request that an SMSF        initiate migrating or sharing a specified service layer session        with the prospective participant.

In step 6, an SMSF determines the session participant(s) that it will betargeting when it performs session migration or sharing. This may eitherbe explicitly defined for the case where an SMSF is servicing anexplicit request to initiate the migration/sharing, or it may be derivedautonomously by an SMSF (e.g. based off of schedule, policy information,or information regarding session participants). For example, in oneembodiment an existing session participant (e.g. an M2M application) mayprovide a new location that it is planning to move to and using thislocation information an SMSF may find an available and compatibleservice layer instance which it can migrate the application's servicelayer session to.

In a second embodiment, a prospective session participant looking tojoin and share an existing session may provide a description of thesession it is looking to join and share. Using this session description,an SMSF may find an available session matching this description which itmay then share with the prospective session participant.

In a third embodiment, a session participant (e.g. an M2M application)may provide a list of prior location(s) it has visited, and using thisinformation, an SMSF may query service layer instances in theselocations and find existing service layer session(s) applicable to thesession participant which can be shared or migrated to service layerinstance(s) in the new location which the session participant nowresides.

In step 7, an SMSF may check whether any prospective sessionparticipant(s) are capable of supporting service layer sessions byquerying each of them (i.e. whether they support M2M service layersession communication). For example, for RoA based implementations, anSMSF may query a corresponding resource which prospective sessionparticipants may use to advertise their session capabilities. For SoAbased implementations, an SMSF may call one or more functions supportedby a prospective session participant which may return their sessioncapabilities to the SMSF.

In step 8, an SMSF may check whether any existing session participant(s)are interested in participating in the specific service layer sessionwhich the SMSF is attempting to migrate or share with them. For the casewhere an existing session participant has requested that a session bemigrated or shared with a new prospective session participant, thesession identifier and/or session descriptor (defined in Table 19) maybe shared with the new participant to give it the opportunity to decidewhether or not it is interested. Similarly, for the case where a newprospective participant has requested that an existing session bemigrated or shared with it, an SMSF may share the information about thenew prospective participant with existing session participants to givethem the opportunity to decide whether or not they are interested insharing/migrating their sessions with it.

In step 9, an SMSF may determine whether to perform session migration orsession sharing with prospective session participants. This may eitherbe explicitly defined for the case where a requesting sessionparticipant is initiating the migration/sharing, or it may be derivedautonomously by an SMSF based off of policy information and/orpreferences of prospective session participants that the SMSF discoverswhen querying them.

In step 10 a, an SMSF may perform service layer session migration bytransferring service layer session context from one session participantto another session participant. This transfer may be done by the SMSFfirst querying session participants to find all context applicable to aparticular session. This querying may be enabled by session participantsmaintaining a session identifier (i.e. tag) with each instance ofsession context that they support. For example, in RoA based servicelayers, a session identifier may be included within each resourceinstance associated with a session. An SMSF may then query and findresources applicable to a particular session based on this sessionidentifier.

After finding applicable session context, an SMSF may copy this contextfrom the session participant which the session is being migrated awayfrom to the session participant where the session is being migratedtowards. During this copying process, an SMSF may also inspect andupdate certain pieces of session context such that it can be used onceit is migrated. For example, a piece of session context that isdependent on session participant addresses or identifiers can be checkedand potentially updated. If the address/identifier matches that of thesession participant which the session is being migrated away from, thisaddress can be updated with the address of the session participant whichthe session is being migrated towards. Once copied, the service layersession context from the session participant which the session is beingmigrated away from may be deleted (if no other session participants areusing it). This migration of service layer session context can include,but is not limited to, one or more of the following: (i) migration ofservice layer subscription information; (ii) migration of groupmembership information; (iii) migration of service layer point ofcontact information; (iv) migration of service layer policies (e.g.message delivery and handling policies); (v) migration of service layersecurity credentials; (vi) migration of service layer device/applicationmanagement context; (vii) migration of discovery metadata; (viii)migration of location metadata; (ix) migration of charging andaccounting metadata; (x) migration of data (e.g. application specifiedcontent within service layer container resources); and/or (xi) migrationof underlying access network connections and/or sessions which a servicelayer session is overlaid on top of

When performing session migration/sharing, an SMSF may differentiatesession participants and their corresponding context. For example, whenone session participant migrates to another service layer instance, itssession context can be migrated to this new service layer instance. Inaddition, other session participants can also be updated by the SMSFaccordingly such that they are aware of this migration. The SMSF may dothis by updating the session context of each session participant.Similarly for session sharing, when a session is shared with a newsession participant, other session participants can be notified of thisby the SMSF updating their session context as well.

Note that in some use case deployments (e.g. when an SMSF is an embeddedcapability within a M2M service layer) migration may involvetransferring service layer session context across multiple service layerinstances before it reaches its final destination. For example, FIG. 27shows the case where service layer session context 448 is first migratedfrom the service layer instance 446 hosted on M2M gateway 444 to theservice layer instance 452 hosted on the M2M server 450, followed by theservice layer instance 452 on the M2M server 450 migrating it to theservice layer instance 456 hosted on M2M gateway 454. Hence this usecase involves two hops. In these sorts of use cases, collaborationbetween SMSF instances hosted within each service layer instance may beused to properly migrate the service layer session. This collaborationmay involve SMSF instances initiating communication with each other andpassing service layer session context between themselves.

For RoA based service layer architectures, the migration operationsdescribed above may be realized by the following SMSF operations:

-   -   1. An SMSF first doing RETRIEVE operations on resources        containing service layer session context hosted by a session        participant which the session is being migrated away from. These        retrieve operations can include query parameters, such as a        session identifier, to find context applicable to a particular        session.    -   2. The SMSF inspecting the retrieved resource representation to        detect cases where context must be updated (e.g. update        addresses of session participants).    -   3. The SMSF doing POST operations to the session participant        which the session is being migrated towards to create resources        containing service layer session context.    -   4. The SMSF doing DELETE operations to remove resources        containing service layer session context hosted by session        participant which the session is being migrated away from (if        not other session participants are using it).

For SoA based service layer architectures, the migration operationsdescribed above may be realized by the following SMSF operations:

-   -   1. An SMSF first calling function(s) hosted by the session        participant which the session is being migrated away from. Via        these function(s), the SMSF can obtain service layer session        context. These functions can support query parameters, such as a        session identifier, to find context applicable to a particular        session.    -   2. The SMSF inspecting service layer session context returned by        the service participant to detect cases where context must be        updated (e.g. update addresses of session participants).    -   3. The SMSF calling function(s) hosted by the session        participant which the session is being migrated towards. Via        these function(s), the SMSF can create a copy of the service        layer session.    -   4. The SMSF calling function(s) hosted by the session        participant which the session is being migrated away from. Via        these function(s), the SMSF can delete service layer session        context.

In step 10 b, an SMSF may perform service layer session sharing. Asimilar method as the one described in step 10 a above for sessionmigration may be used. However, after copying service layer sessioncontext to a new session participant, it is not needed to be deletedfrom the session participant where it was copied from. This results insession participants having shared session context. In addition, one ormore SMSF(s) can be used to keep the session context updated andsynchronized between session participants. For example, the SMSF(s) canperform inter-SMSF communication/collaboration to ensure that the copiesof service layer session context hosted by session participants remainsin sync with one another. In doing so, session participants can share aservice layer session.

In step 11, an SMSF may coordinate with underlying access network nodesto manage underlying access network connections which service layersessions are overlaid on top of This can include:

-   -   1. Coordinating the tear-down and/or retiring of underlying        access network connections no longer required by a session        participant (e.g. tear down of access network connections used        by session participant which the session is being migrated away        from).    -   2. Coordinating the update of an existing underlying access        network connections with new information regarding a session        participant for which a service layer session has been migrated        to or shared with (e.g. new location of session participant such        that the underlying access network can migrate an existing        connection or establish a new connection based on the        participants new location).    -   3. Coordinating the establishment of new underlying access        network connections to support a new session participant for        which a service layer session has been migrated to or shared        with (e.g. provide service layer session information to the        underlying access network such that it can configure and        establish a new access network connection(s) more efficiently or        effectively). For example, a service layer session migration or        sharing schedule can be provided to the underlying access        network and this schedule can be used by the access network to        proactively establish and tear down the underlying access        network connections around this sharing or migration schedule.

In step 12, an SMSF may complete processing of a service layer sessionmigration or sharing trigger/request. Upon completion, the SMSF maytransition back to step 4 where it continues to collect and maintainsession context and wait for the next trigger to occur.

It is understood that the functionality of the SMSF, as illustrated inFIG. 30, may be implemented in the form of software (i.e.,computer-executable instructions) stored in a memory of, and executingon a processor of, a node of an M2M network (e.g., a server, gateway,device, or other computer system), such as one of those illustrated inFIGS. 37C or 37D described below. That is, the method illustrated inFIG. 30 may be implemented in the form of software (i.e.,computer-executable instructions) stored in a memory of a network node,such as for example the node or computer system illustrated in FIGS. 37Cor 37D, which computer executable instructions, when executed by aprocessor of the node, perform the steps illustrated in FIG. 30. It isalso understood that any transmitting and receiving steps illustrated inFIG. 30 may be performed by communication circuitry of the node undercontrol of the processor of the node and the computer-executableinstructions (e.g., software) that it executes.

Disclosed hereinafter are embodiments in which the SMSF and the methodsdescribed above for M2M service layer session migration and sharing areimplemented in a network that operates in accordance with the oneM2Marchitecture. As mentioned above, oneM2M is defining capabilitiessupported by the oneM2M service layer. These capabilities are referredto as Capability Service Functions (CSFs). The oneM2M service layer isreferred to as a Capability Services Entity (CSE). As shown in FIG. 31,a CSE 271′ supports a set of CSFs 270′. In one embodiment, the CSE 271′may be a modified version of the CSE 272 illustrated in FIG. 9 anddescribed above, and the set of CSFs 271′ likewise may be a modifiedversion of the CSFs 271 in FIG. 9 and also described above.

One version of the oneM2M specification for a CSE includes a preliminarydefinition of a Service Session Management (SSM) CSF. This initialdefinition supports service layer session establishment between sessionparticipants (e.g. M2M applications and M2M service layer instances),however it does not support service layer session migration nor sharing.To address this gap, the SMSF functionality described above and belowmay be incorporated within the current version of the oneM2M SSM CSF.This is illustrated in FIG. 31, where an SMSF (as described above andbelow) is incorporated as part of a Service Session Management (SSM) CSF272′. In one embodiment, the SSM CSF 272′ may be a modified version ofthe SSM CSF 272 illustrated in FIG. 9 and described above. Byincorporating the SMSF (e.g., SMSF 460) into an SSM CSF (e.g., SSM CSF272′), the service layer session migration and sharing functionalitydescribed herein can be supported by the SSM CSF.

According to the oneM2M Resource Oriented Architecture (RoA), asdescribed for example in OneM2M Functional Architecture, oneM2M-TS-0001,version 0.4.3, individual CSFs support a set of “resources” that serveas their respective interface, where a resource is a uniquelyaddressable entity in the architecture. A resource has a representationthat can be manipulated via RESTful methods such as Create, Retrieve,Update, and Delete and is addressed using a Universal ResourceIdentifier (URI). A resource may contain child resource(s) andattribute(s). A child resource is a resource that has a containmentrelationship with a parent resource. The parent resource representationcontains references to its child resources(s). The lifetime of achild-resource is limited by the parent's resource lifetime. Eachresource supports a set of “attributes” that store information of theresource.

Described hereinafter are oneM2M resource structure enhancements forsupporting session migration and sharing functionality for the currentlydefined oneM2M SSM CSF. Note that the oneM2M defined graphicalrepresentation for describing resource structures is the following: (i)square boxes are used for resources and child resources; (ii) squareboxes with round corners are used for attribute; (iii) parallelogramsare used for collection of resources; (iv) multiplicity of eachattribute and child resource is defined; and (v) resource namesdelimited with “<” and “>” indicate names assigned during the creationof the resource.

FIG. 32 shows a modification of a oneM2M <session> resource structure,which consists of a set of <session> resource attributes. As shown, theresource structure may be modified by adding attributes to the <session>resource to support session migration and sharing functionality. Theseattributes are listed and described in Table 20 below.

TABLE 20 <session> Attributes for Session Migration and SharingAttribute Name Multiplicity Description migrationEnabled 1 Indicateswhether this session participant allows SMSF migration of a servicelayer session away or towards it. sharingEnabled 1 Indicates whetherthis session participant allows SMSF sharing of its session with anothersession participant SMSFschedule 1 This schedule can specify informationsuch as set times when an SMSF is to perform session migration orsharing. The schedule can also include a list of session participantsfor which an SMSF is to target when performing session migration orsharing at the specified scheduled times. SMSFtargets 1 Can be used toexplicitly specify one or more prospective session participants tomigrate or share the session with when the SMSF is explicitly triggeredto do so. SMSFtrigger 1 Can be used to explicitly trigger migration orsharing of the session (e.g. by an existing session participant to aprospective session participant).

The migrationOk and sharingOK attributes may be used to enable ordisable the SMSF from performing session migration or sharing for agiven session. Note that these attributes do not necessarily need to bemutually exclusive of one another. The same session may be shared and/ormigrated. The SMSFschedule attribute may be used to schedule when theSMSF performs session migration or sharing.

One example embodiment for encoding the SMSFschedule attribute is toprovide a time window which the SMSF can use to schedule migration orsharing of a session. This time window may be expressed in severaldifferent formats. The following are a few examples.

In one embodiment, the time window may be expressed as a comma separatedstart and end time, for example,

-   -   2014-12-24T17:00:00+1:00,    -   2014-12-24T21:00:00+1:00

In another embodiment, the time window may be expressed as an XMLencoded start and end time, for example,

<smsfSchedule> <start> 2014-12-24T17:00:00+1:00 </start> <end>2014-12-24T21:00:00+1:00 </end> </smsfSchedule>

As yet another example, the time window may be specified as a JSONencoded start and end time, for example,

“smsfSchedule”: { “start”: “2014-12-24T17:00:00+1:00”, “end”:“2014-12-24T21:00:00+1:00” }

The SMSFtargets attribute may be used to specify the prospective sessionparticipants where a session is to be migrated or shared with. In oneembodiment, the SMSFtargets attribute may be encoded as a list of URIswhere each URI is referenced to an active or prospective sessionparticipant. This list may be expressed in several different formats.

As a first example, the list may be expressed as a comma separate listof URIs, such as,

-   -   sessionParticipant1@example.com,    -   sessionParticipant2@example.com,    -   sessionParticipant3@example.com        As another example, the list may be encoded as an XML encoded        list of URIs, such as,

<smsfTargets> <smsfTarget> participant1@example.com </smsfTarget><smsfTarget> participant2@example.com </smsfTarget> <smsfTarget>participant3@example.com </smsfTarget> </smsfTargets>As still another example, the list may be encoded as a JSON encoded listof URIs, such as,

“smsfTargets”: [ {smsfTarget:  “participant1@example.com”}, {smsfTarget:“ participant2@example.com”}, {smsfTarget: “ participant2@example.com”}]

The SMSFtrigger attribute may be used to explicitly trigger the SMSF toperform session migration or sharing.

One example embodiment for encoding the SMSFtrigger attributed is to usea list of conditions where each condition is a criteria for the SMSF toinitiate session migration or sharing. In one embodiment, the SMSF maysupport a criteria syntax. If one or more criteria in the list isevaluated to true by the SMSF, it may trigger session migration orsharing. Like the previous lists, this list may be expressed in severaldifferent formats. It may be encoded as a comma separate list ofconditions, for example,

-   -   location of participant1@is 57.64911,10.40744″,    -   status of participant2@example.com is unavailable        Alternatively, it may be encoded as an XML encoded list of        conditions, for example,

<smsfTriggers> <smsfTrigger><sessionParticipant>participant1@example.com”</sessionParticipant><location>57.64911,10.40744</location> </smsfTrigger> <smsfTrigger><sessionParticipant>participant2@example.com”</sessionParticipant><status>unavailable</status> </smsfTrigger> </smsfTriggers>And it may be encoded as a JSON encoded list of conditions, for example,

“smsfTriggers”: [ {smsfTrigger: “sessionParticipant”:participant1@example.com, “location”: “57.64911,10.40744” } {smsTrigger: “sessionParticipant”: participant2@example.com, “status”: “unavailable”} ]

FIG. 33 shows a modification of a oneM2M <sessionPolicy> resourcestructure. In particular, service layer session migration and sharingspecific policy attributes may be added to the <sessionPolicy> resource.In one embodiment, these attributes include a policyType attribute and apolicy attribute. Each is described in greater detail in Table 21.

TABLE 21 <sessionPolicy> Attributes for Session Migration and SharingAttribute Multi- Name plicity Description policyType 1 The following newpolicy types specific to session migration and sharing may be provided:Session migration policy type - Used to indicate that policy pertains tosession migration Session sharing policy type - Used to indicate thatpolicy pertains to session sharing Alternatively, a single SMSF policytype may be defined. policy 1 In one embodiment, this policy attributemay be used to define the policies specific to session migration andsharing such as the following: Policies to specify rules such as whattype of session context can be migrated or shared by certain sessionparticipants, which session participants are permitted to communicatewith one another, and specific conditions which are to trigger an SMSFto perform session migration or sharing.

The policyType attribute may be used to specify whether a session policyis a session migration policy or a session sharing policy. The policyattribute may be used to specify session migration or sharing specificpolicies which are used by the SMSF.

In one embodiment, a session policy definition may be encoded bydefining a data structure consisting of session migration and sharingrules that are made up of information such as trigger conditions,scheduling information, and session participants which the SMSF can usewhen performing session migration or sharing. This data structure mayeither contain this information embedded within it or it may includelinks to other resources containing this information (e.g. links to the<session> resource defined above which supports smsfSchedule,smsfTargets, and smsfTriggers attributes).

The following is an example of an XML encoded policy definition:

<smsfRule>  <smsfSchedule> <start> 2014-12-24T17:00:00+1:00 </start><end> 2014-12-24T21:00:00+1:00 </end> </smsfSchedule> <smsfTriggers><smsfTrigger><sessionParticipant>participant1@example.com”</sessionParticipant><location>57.64911,10.40744</location> </smsfTrigger> <smsfTrigger><sessionParticipant>participant2@example.com”</sessionParticipant><status>unavailable</status> </smsfTrigger>  </smsfTriggers><smsfTargets> <smsfTarget> participant1@example.com </smsfTarget><smsfTarget> participant2@example.com </smsfTarget> <smsfTarget>participant3@example.com </smsfTarget> </smsfTargets> </smsfRule>An example JSON encoded policy definition may be:

“smsfRule”: { “smsfSchedule”: { “start”: “2014-12-24T17:00:00+1:00”,“end”: “2014-12-24T21:00:00+1:00” } “smsfTargets”: [{smsfTarget:  “participant1@example.com”}, {smsfTarget: “participant2@example.com”}, {smsfTarget: “ participant2@example.com”} ] “smsfTriggers”: [ {smsfTrigger: “sessionParticipant”:participant1@example.com, “location”: “57.64911,10.40744” } {smsTrigger: “sessionParticipant”: participant2@example.com, “status”: “unavailable”} ] }

FIG. 34 shows a modification of a oneM2M <sessionContext> resourcestructure. As shown, service layer session migration and sharing contexttypes may be added to the <sessionContext> resource. In particular, thesession context attributes defined in Table 22 may be added. Note thatthis context may be applicable to all the participants of a givensession or may be specific to an individual session participant. Forexample, for context that is specific to an individual sessionparticipant, it may be instantiated under (or linked to) a<sessionParticipant> resource, as shown in FIG. 35.

TABLE 22 <sessionContext> Attributes for Session Migration and SharingAttribute Name Multiplicity Description contextType 1 In one embodiment,the following context types may be used by the proposed SMSF to migrateand share a service layer session with one or more prospective sessionparticipants as described herein. Each of these context types is definedin Tables 18 and 19: Session migration or sharing trigger context typeSession participant subscription context type Session participantsecurity context type Session participant charging/transaction contexttype Session participant service layer routing context type Sessionparticipant location context type Session participant data context typeSession participant discovery context type Underlying transport sessioncontext type context 1 In one embodiment, the definition of this contextattribute may be extended to support a context instance representationor a link to a context instance representation of type equal to one ofthe session migration and sharing context types defined above.

In one embodiment, a session context definition may be encoded bydefining a data structure consisting of session migration and sharingcontext which the SMSF can use when performing session migration orsharing. This data structure may either contain this informationembedded within it or it may include links to other resources containingthis information (e.g. links to the <session> resource defined abovewhich supports attributes such as smsfTargets attributes).

The following is an example of an XML encoded context definition:

<smsfContext> <smsfParticipant> <id> participant2@example.com</id><currentLocation> 57.64911,10.40744</location></currentLocation><sessionId>session123</sessionId><sessionCredential>XYZ367</sessionCredential> <chargingRecord>link tocharging record resource</chargingRecord> <sessionData>link to containerresource</sessionData> <routingInfo>IP address and port</routingInfo><discoveryInfo>semantic tags or links to ontologies</discoveryInfor><history>link to transaction history resource</history><accessNWInfo>Access NW IDs and routing info</accessNWInfo></smsfParicipant> </smsfContext>Here is an example of a JSON encoded context definition:

“smsfContext”: {  “smsfParticipant”: { “id”: “participant2@example.com”,“currentLocation”: “57.64911,10.40744”, “sessionId”: “session123”,“sessionCredential”: “XYZ367”, “chargingRecord”: “link to chargingrecord resource”, “sessionData”: “link to container resource”,“routingInfo”: “IP address and port”, “discoveryInfo”: “semantic tags orlinks to ontologies”,   “history”: “link to transaction historyresource”,   “<accessNWInfo”: “Access NW IDs and routing info” } }

FIGS. 36A-36C illustrate one example embodiment of a method formigrating a oneM2M service layer session and demonstrate how the oneM2MSMSF resource extensions discussed above may be used in the migrationprocess. In this example, a M2M service layer session between an M2Mapplication 472 hosted on an M2M device 470 and a service layer instance474 of a first M2M gateway 476 (M2M GW #1) is being migrated from theservice layer instance hosted on that first M2M gateway 476 to theservice layer instance 486 hosted on a second M2M gateway 488 (M2M GW#2), via the service layer instance 480 hosted on an M2M server 482. Asshown, in this embodiment, each of the service layer instances 474, 480,and 486 includes a Service Session Management (SSM) CSF 478, 484, and490, respectively, which includes the Session Migration and SharingFunction (SMSF) functionality illustrated, for example, in FIG. 30 anddescribed above. In this example, migration is being performed tosupport a mobile M2M device (e.g., device 470) that has moved from afirst location (shown on the left of FIG. 36A) to a new location (shownon the right of FIG. 36A).

In this embodiment, the migration is performed via collaboration betweenthe SMSFs (478, 484, 490) instantiated on M2M GW #1 476, M2M server 482,and M2M GW #2 488. Hence, the migration path of service layer sessioncontext is from M2M GW #1 476 to M2M server 482 followed by M2M server482 to M2M GW #2 488. Also note that in other embodiments (not shown),the migration path of service layer session context may be from M2M GW#1 476 to M2M GW #2 488 directly, in which case the M2M server 482 wouldnot play a role. Also note that although service layer migration isspecifically shown in this example, service layer session sharing may beperformed instead using similar steps, but replacing the migrationoperations with corresponding sharing operations as described above.

Referring to FIG. 36A, in steps 001 a and 001 b, the M2M application 472hosted on the M2M device 470 registers to the M2M service layer instance474 hosted on M2M GW #1 476. This registration is performed by creatinga oneM2M defined <application> resource on M2M GW #1 476, as illustratedat 492.

Next, the M2M application 472 hosted on the M2M device 470 establishes aM2M service layer session between itself and the service layer instance474 hosted on M2M GW #1 476. This is initiated by the M2M applicationcreating a oneM2M defined <session> resource, as shown in step 002 a.When doing this, the application 472 indicates that it would like thesession to be migratable by configuring the migrationOk attribute to‘TRUE’. The application also includes its unique application instanceidentifier ('appXYZ123′) in this request.

In steps 003 a and 003 b, the SSM/SMSF 478 hosted on M2M GW #1 476checks if there is a migratable session already available for M2Mapplication ‘appXYZ123’ or not. This may be done by querying the servicelayer instance 480 on the M2M server 482 to see whether any sessionresources associated with ‘appXYZ123’ have either been created orannounced to the server. In this example, there are none. As a result,as shown at 494, the SSM/SMSF 478 hosted on M2M GW #1 476, creates a new<session> resource for the M2M application 472. When creating this<session> resource, a unique ‘sessionID’ (e.g., “XYZ123”) is allocatedand assigned to the session by the SSM/SMSF. This ‘sessionID’ isreturned to the M2M application in step 002 b.

In steps 004 a and 004 b, after creating the new <session> resource, theSSM/SMSF 478 on M2M GW #1 476 announces this resource to the servicelayer instance 480 hosted on the M2M server 480. This is done since theM2M application 472 has set the ‘migrationOK’ flag to ‘TRUE’ in the<session> create request (step 002 a). By announcing the <session>resource, the SSM/SMSF 478 enables the session to be discoverable bySSM/SMSFs hosted on other service layer instances in the network (e.g.SSM/SMSF 490 hosted on M2M GW #2 488). When announcing to the M2M server482, the announced resource includes the ‘sessionID’ and a link back tothe <session> resource hosted within the service layer 474 on M2M GW #1476.

Next, at steps 005 a and 005 b, the M2M application 472 creates aservice layer session policy resource which defines which types ofsession context are to be collected and maintained by the SSM/SMSF whilethe session is active as well as which context is to be migrated if/whenthe session is migrated to another service layer. The creation of thesession policy resource is depicted at 496.

Referring to FIG. 36B, which continues the present example, step 6depicts normal session-based communication occurring between the M2Mapplication 472 and the service layer instance 474 hosted on M2M GW #1476.

As the session-based communications occur, the SSM/SMSF 478 hosted onM2M GW #1 476 may collect context (such as the context defined in Table19) pertaining to the service layer session based on the <sessionPolicy>rules. This context may be stored by the SSM/SMSF 478 in<sessionContext> resources created on M2M GW #1 476. The SSM/SMSF 478may tag these resources with the sessionID of the present session (e.g.,“XYZ123”).

In the present example, as depicted in steps 008 a and 008 b, the M2Mdevice 470 moves from its first location to a second location. In thisexample, after moving, the device 470 is no longer in the proximity ofM2M GW #1 476. Instead it is in the proximity of M2M GW #2 488.

In steps 009 a and 009 b, the M2M device registers to the service layerinstance 486 hosted on M2M GW #2 488.

Referring to FIG. 36C, which again continues the present example, instep 010 a, the M2M application 472 hosted on the M2M device 470attempts to establish a M2M service layer session between itself and theservice layer instance 486 hosted on M2M GW #2 488. This is initiated bythe M2M application 472 registering to the service layer instance 486hosted on M2M GW #2 488 and providing it with the sessionID (e.g.,“XYZ123”) of the session it established with the service layer hosted onM2M GW #1 476.

In step 011 a, the SSM/SMSF 490 hosted on M2M GW #2 488 is triggered bythe M2M application registration because it included a sessionID. TheSSM/SMSF 490 checks if there is a migratable session already availablefor M2M application ‘appXYZ123’ or not. It does this in step 011 b byquerying the service layer 480 on its parent service layer (i.e. M2Mserver 482) to see whether any session resources associated with‘appXYZ123’ have either been created or announced to it. In thisparticular case, there is one and a link to the corresponding <session>resource hosted on M2M GW #1 476 is returned to the SSM/SMSF 490 on M2MGW #2 488, as shown in step 011 c.

In step 12, the SSM/SMSF 490 hosted on M2M GW #2 488 migrates theservice layer session from the service layer 474 on M2M GW #1. To dothis, the SSM/SMSF 490 first retrieves the <sessionPolicy> resource(s)to determine if there are any session migration policies it needs toabide by. Using these policies the SSM/SMSF 490 may determine whether itcan migrate the session to M2M GW #2 488. If yes, then the SSM/SMSF 490may selectively retrieve the <session>, <sessionPolicy>, and<sessionContext> resources and create corresponding versions within theresource tree of the service layer 486 hosted on M2M GW #2 488. Whenperforming the retrieves, the SSM/SMSF 490 may include a query stringparameter that includes the sessionID. This allows the SSM/SMSF 490 tofind the session resources applicable to the session it is looking tomigrate. Upon receiving responses to these retrieves, the SSM/SMSF 490may inspect the retrieved resource representations to detect cases wherecontext must be updated (e.g. to account for changes in sessionparticipants that may no longer be valid due to the migration). Once theSSM/SMSF 490 completes the retrieval and creation of process, it canthen delete the session from the service layer hosted on M2M GW #1 476.A response to the session create request sent in step 010 a may then besent to the M2M application 472 in step 010 b.

In step 013, the SSM/SMSF 490 hosted on M2M GW #2 488 may coordinatewith the underlying access network to pass service layer sessioninformation to it. Using this information, the underlying access networkmay coordinate access network connections corresponding to the M2Mdevice 470 with the service layer session. For example, it maycoordinate the tear-down and/or retiring of underlying access networkconnections no longer required by the M2M device 470 to connect to M2MGW #1 476, or sharing service layer session schedule information (e.g.times when the service layer session is active/in-active, sessionmigration schedule, etc.). This may be used by the access network toproactively establish and tear down the underlying access networkconnections leveraging this information.

It is understood that the entities performing the steps illustrated inFIGS. 36A-C may be logical entities that may be implemented in the formof software (i.e., computer-executable instructions) stored in a memoryof, and executing on a processor of, a node of an M2M network (e.g., aserver, gateway, device, or other computer system), such as one of thoseillustrated in FIG. 37C or 37D described below. That is, the methodillustrated in FIGS. 36A-36C may be implemented in the form of software(i.e., computer-executable instructions) stored in a memory of a networknode, such as for example the node or computer system illustrated inFIGS. 37C or 37D, which computer executable instructions, when executedby a processor of the node, perform the steps illustrated in FIGS.36A-C. It is also understood that any transmitting and receiving stepsillustrated in FIGS. 36A-C may be performed by communication circuitryof the node under control of the processor of the node and thecomputer-executable instructions (e.g., software) that it executes.

Embodiments set forth herein are described in terms of arepresentational state transfer (REST) architecture, with components andentities described conforming to the constraints of a REST architecture(RESTful architecture). A RESTful architecture is described in terms ofthe constraints applied to components, entities, connectors, and dataelements used in the architecture rather than in terms of physicalcomponent implementation or communications protocols used. Thus, theroles and functions of the components, entities, connectors, and dataelements will be described. In a RESTful architecture, representationsof uniquely addressable resources are transferred between entities. Whenhandling resources in a RESTful architecture, there are basic methodsthat may be applied to resources, such as Create (create childresources), Retrieve (read the content of the resource), Update (writethe content of the resource) or Delete (delete the resource.) Oneskilled in the art will recognize that implementations of the instantembodiments may vary while remaining within the scope of the presentdisclosure. One skilled in the art will also recognize that thedisclosed embodiments are not limited to implementations using theoneM2M architecture that is used herein to describe exemplaryembodiments. The disclosed embodiments may be implemented inarchitectures and systems, such as ETSI M2M, 3GPP MTC, OMA LWM2M, andother like M2M systems and architectures.

Example M2M/IoT/WoT Communication System

FIG. 37A is a diagram of an example machine-to machine (M2M), Internetof Things (IoT), or Web of Things (WoT) communication system 10 in whichone or more disclosed embodiments may be implemented. Generally, M2Mtechnologies provide building blocks for the IoT/WoT, and any M2Mdevice, M2M gateway, M2M server, or M2M service platform may be acomponent or node of the IoT/WoT as well as an IoT/WoT service layer,etc.

As shown in FIG. 37A, the M2M/IoT/WoT communication system 10 includes acommunication network 12. The communication network 12 may be a fixednetwork (e.g., Ethernet, Fiber, ISDN, PLC, or the like) or a wirelessnetwork (e.g., WLAN, cellular, or the like) or a network ofheterogeneous networks. For example, the communication network 12 may becomprised of multiple access networks that provide content such asvoice, data, video, messaging, broadcast, or the like to multiple users.For example, the communication network 12 may employ one or more channelaccess methods, such as code division multiple access (CDMA), timedivision multiple access (TDMA), frequency division multiple access(FDMA), orthogonal FDMA (OFDMA), single-carrier FDMA (SC-FDMA), and thelike. Further, the communication network 12 may comprise other networkssuch as a core network, the Internet, a sensor network, an industrialcontrol network, a personal area network, a fused personal network, asatellite network, a home network, or an enterprise network for example.

As shown in FIG. 37A, the M2M/IoT/WoT communication system 10 mayinclude the Infrastructure Domain and the Field Domain. TheInfrastructure Domain refers to the network side of the end-to-end M2Mdeployment, and the Field Domain refers to the area networks, usuallybehind an M2M gateway. The Field Domain and Infrastructure Domain mayboth comprise a variety of different network nodes (e.g., servers,gateways, device, and the like). For example, the Field Domain mayinclude M2M gateways 14 and terminal devices 18. It will be appreciatedthat any number of M2M gateway devices 14 and M2M terminal devices 18may be included in the M2M/IoT/WoT communication system 10 as desired.Each of the M2M gateway devices 14 and M2M terminal devices 18 areconfigured to transmit and receive signals, using communicationscircuitry, via the communication network 12 or direct radio link. A M2Mgateway 14 allows wireless M2M devices (e.g. cellular and non-cellular)as well as fixed network M2M devices (e.g., PLC) to communicate eitherthrough operator networks, such as the communication network 12 ordirect radio link. For example, the M2M devices 18 may collect data andsend the data, via the communication network 12 or direct radio link, toan M2M application 20 or other M2M devices 18. The M2M devices 18 mayalso receive data from the M2M application 20 or an M2M device 18.Further, data and signals may be sent to and received from the M2Mapplication 20 via an M2M service layer 22, as described below. M2Mdevices 18 and gateways 14 may communicate via various networksincluding, cellular, WLAN, WPAN (e.g., Zigbee, 6LoWPAN, Bluetooth),direct radio link, and wireline for example.

Referring to FIG. 37B, the illustrated M2M service layer 22 in the fielddomain provides services for the M2M application 20, M2M gateways 14,and M2M devices 18 and the communication network 12. It will beunderstood that the M2M service layer 22 may communicate with any numberof M2M applications, M2M gateways 14, M2M devices 18, and communicationnetworks 12 as desired. The M2M service layer 22 may be implemented byone or more nodes of the network, which may comprises servers,computers, devices, or the like. The M2M service layer 22 providesservice capabilities that apply to M2M devices 18, M2M gateways 14, andM2M applications 20. The functions of the M2M service layer 22 may beimplemented in a variety of ways, for example as a web server, in thecellular core network, in the cloud, etc.

Similar to the illustrated M2M service layer 22, there is the M2Mservice layer 22′ in the Infrastructure Domain. M2M service layer 22′provides services for the M2M application 20′ and the underlyingcommunication network 12′ in the infrastructure domain. M2M servicelayer 22′ also provides services for the M2M gateways 14 and M2M devices18 in the field domain. It will be understood that the M2M service layer22′ may communicate with any number of M2M applications, M2M gatewaysand M2M devices. The M2M service layer 22′ may interact with a servicelayer by a different service provider. The M2M service layer 22′ by oneor more nodes of the network, which may comprises servers, computers,devices, virtual machines (e.g., cloud computing/storage farms, etc.) orthe like.

Referring also to FIG. 37B, the M2M service layers 22 and 22′ provide acore set of service delivery capabilities that diverse applications andverticals can leverage. These service capabilities enable M2Mapplications 20 and 20′ to interact with devices and perform functionssuch as data collection, data analysis, device management, security,billing, service/device discovery etc. Essentially, these servicecapabilities free the applications of the burden of implementing thesefunctionalities, thus simplifying application development and reducingcost and time to market. The service layers 22 and 22′ also enable M2Mapplications 20 and 20′ to communicate through various networks 12 and12′ in connection with the services that the service layers 22 and 22′provide.

The M2M applications 20 and 20′ may include applications in variousindustries such as, without limitation, transportation, health andwellness, connected home, energy management, asset tracking, andsecurity and surveillance. As mentioned above, the M2M service layer,running across the devices, gateways, servers and other nodes of thesystem, supports functions such as, for example, data collection, devicemanagement, security, billing, location tracking/geofencing,device/service discovery, and legacy systems integration, and providesthese functions as services to the M2M applications 20 and 20′.

As mentioned above, the Session Migration and Sharing Function (SMSF)described herein may be implemented as part of the service layer of anM2M system. Generally, a service layer, such as the service layers 22and 22′ illustrated in FIGS. 37A and 37B, defines a software middlewarelayer that supports value-added service capabilities through a set ofApplication Programming Interfaces (APIs) and underlying networkinginterfaces. Both the ETSI M2M and oneM2M architectures define a servicelayer. ETSI M2M's service layer is referred to as the Service CapabilityLayer (SCL). The SCL may be implemented in a variety of different nodesof the ETSI M2M architecture. For example, an instance of the servicelayer may be implemented within an M2M device (where it is referred toas a device SCL (DSCL)), a gateway (where it is referred to as a gatewaySCL (GSCL)) and/or a network node (where it is referred to as a networkSCL (NSCL)). The oneM2M service layer supports a set of Common ServiceFunctions (CSFs) (i.e., service capabilities). An instantiation of a setof one or more particular types of CSFs is referred to as a CommonServices Entity (CSE) which can be hosted on different types of networknodes (e.g. infrastructure node, middle node, application-specificnode). The Third Generation Partnership Project (3GPP) has also definedan architecture for machine-type communications (MTC). In thatarchitecture, the service layer, and the service capabilities itprovides, are implemented as part of a Service Capability Server (SCS).Whether embodied in a DSCL, GSCL, or NSCL of the ETSI M2M architecture,in a Service Capability Server (SCS) of the 3GPP MTC architecture, in aCSF or CSE of the oneM2M architecture, or in some other node of anetwork, an instance of the service layer may be implemented as alogical entity (e.g., software, computer-executable instructions, andthe like) executing either on one or more standalone nodes in thenetwork, including servers, computers, and other computing devices ornodes, or as part of one or more existing nodes. As an example, aninstance of a service layer or component thereof may be implemented inthe form of software running on a network node (e.g., server, computer,gateway, device or the like) having the general architecture illustratedin FIG. 37C or FIG. 37D described below.

Further, the SMSF and other methods and functionalities described hereinmay be implemented as part of an M2M network that uses a ServiceOriented Architecture (SOA) and/or a Resource-Oriented Architecture(ROA) to access services such as the SMSF of the present application.

FIG. 37C is a block diagram of an example hardware/software architectureof a M2M network node 30, such as an M2M device 18, an M2M gateway 14,an M2M server, or the like. As shown in FIG. 37C, the M2M node 30 mayinclude a processor 32, non-removable memory 44, removable memory 46, aspeaker/microphone 38, a keypad 40, a display, touchpad, and/orindicators 42, a power source 48, a global positioning system (GPS)chipset 50, and other peripherals 52. The node 30 may also includecommunication circuitry, such as a transceiver 34 and a transmit/receiveelement 36. It will be appreciated that the M2M node 30 may include anysub-combination of the foregoing elements while remaining consistentwith an embodiment. This node may be a node that implements the SMSFfunctionality described herein.

The processor 32 may be a general purpose processor, a special purposeprocessor, a conventional processor, a digital signal processor (DSP), aplurality of microprocessors, one or more microprocessors in associationwith a DSP core, a controller, a microcontroller, Application SpecificIntegrated Circuits (ASICs), Field Programmable Gate Array (FPGAs)circuits, any other type of integrated circuit (IC), a state machine,and the like. In general, the processor 32 may executecomputer-executable instructions stored in the memory (e.g., memory 44and/or memory 46) of the node in order to perform the various requiredfunctions of the node. For example, the processor 32 may perform signalcoding, data processing, power control, input/output processing, and/orany other functionality that enables the M2M node 30 to operate in awireless or wired environment. The processor 32 may runapplication-layer programs (e.g., browsers) and/or radio access-layer(RAN) programs and/or other communications programs. The processor 32may also perform security operations such as authentication, securitykey agreement, and/or cryptographic operations, such as at theaccess-layer and/or application layer for example.

As shown in FIG. 37C, the processor 32 is coupled to its communicationcircuitry (e.g., transceiver 34 and transmit/receive element 36). Theprocessor 32, through the execution of computer executable instructions,may control the communication circuitry in order to cause the node 30 tocommunicate with other nodes via the network to which it is connected.In particular, the processor 32 may control the communication circuitryin order to perform the transmitting and receiving steps describedherein and in the claims. While FIG. 37C depicts the processor 32 andthe transceiver 34 as separate components, it will be appreciated thatthe processor 32 and the transceiver 34 may be integrated together in anelectronic package or chip.

The transmit/receive element 36 may be configured to transmit signalsto, or receive signals from, other M2M nodes, including M2M servers,gateways, device, and the like. For example, in an embodiment, thetransmit/receive element 36 may be an antenna configured to transmitand/or receive RF signals. The transmit/receive element 36 may supportvarious networks and air interfaces, such as WLAN, WPAN, cellular, andthe like. In an embodiment, the transmit/receive element 36 may be anemitter/detector configured to transmit and/or receive IR, UV, orvisible light signals, for example. In yet another embodiment, thetransmit/receive element 36 may be configured to transmit and receiveboth RF and light signals. It will be appreciated that thetransmit/receive element 36 may be configured to transmit and/or receiveany combination of wireless or wired signals.

In addition, although the transmit/receive element 36 is depicted inFIG. 37C as a single element, the M2M node 30 may include any number oftransmit/receive elements 36. More specifically, the M2M node 30 mayemploy MIMO technology. Thus, in an embodiment, the M2M node 30 mayinclude two or more transmit/receive elements 36 (e.g., multipleantennas) for transmitting and receiving wireless signals.

The transceiver 34 may be configured to modulate the signals that are tobe transmitted by the transmit/receive element 36 and to demodulate thesignals that are received by the transmit/receive element 36. As notedabove, the M2M node 30 may have multi-mode capabilities. Thus, thetransceiver 34 may include multiple transceivers for enabling the M2Mnode 30 to communicate via multiple RATs, such as UTRA and IEEE 802.11,for example.

The processor 32 may access information from, and store data in, anytype of suitable memory, such as the non-removable memory 44 and/or theremovable memory 46. For example, the processor 32 may store sessioncontext in its memory, as described above. The non-removable memory 44may include random-access memory (RAM), read-only memory (ROM), a harddisk, or any other type of memory storage device. The removable memory46 may include a subscriber identity module (SIM) card, a memory stick,a secure digital (SD) memory card, and the like. In other embodiments,the processor 32 may access information from, and store data in, memorythat is not physically located on the M2M node 30, such as on a serveror a home computer. The processor 32 may be configured to controllighting patterns, images, or colors on the display or indicators 42 toreflect the status of an M2M service layer session migration or sharingor to obtain input from a user or display information to a user aboutthe node's session migration or sharing capabilities or settings. Inanother example, the display may show information with regard to asession state. Additionally, the display 42 may be used to present agraphical user interface to a user—which, for example, may be layered ontop of the RESTful user/application API described above for a oneM2Membodiment—to allow a user to interactively establish and manage an E2Esession, or the migration or sharing thereof, via the underlying servicelayer session functionality described herein. An example of suchgraphical user interface is illustrated in FIG. 38 and described below.

The processor 32 may receive power from the power source 48, and may beconfigured to distribute and/or control the power to the othercomponents in the M2M node 30. The power source 48 may be any suitabledevice for powering the M2M node 30. For example, the power source 48may include one or more dry cell batteries (e.g., nickel-cadmium (NiCd),nickel-zinc (NiZn), nickel metal hydride (NiMH), lithium-ion (Li-ion),etc.), solar cells, fuel cells, and the like.

The processor 32 may also be coupled to the GPS chipset 50, which isconfigured to provide location information (e.g., longitude andlatitude) regarding the current location of the M2M node 30. It will beappreciated that the M2M node 30 may acquire location information by wayof any suitable location-determination method while remaining consistentwith an embodiment.

The processor 32 may further be coupled to other peripherals 52, whichmay include one or more software and/or hardware modules that provideadditional features, functionality and/or wired or wirelessconnectivity. For example, the peripherals 52 may include anaccelerometer, an e-compass, a satellite transceiver, a sensor, adigital camera (for photographs or video), a universal serial bus (USB)port, a vibration device, a television transceiver, a hands freeheadset, a Bluetooth® module, a frequency modulated (FM) radio unit, adigital music player, a media player, a video game player module, anInternet browser, and the like.

FIG. 37D is a block diagram of an exemplary computing system 90 whichmay also be used to implement one or more nodes of an M2M network, suchas an M2M server, gateway, device, or other node. Computing system 90may comprise a computer or server and may be controlled primarily bycomputer readable instructions, which may be in the form of software,wherever, or by whatever means such software is stored or accessed. Suchcomputer readable instructions may be executed within a processor, suchas central processing unit (CPU) 91, to cause computing system 90 to dowork. In many known workstations, servers, and personal computers,central processing unit 91 is implemented by a single-chip CPU called amicroprocessor. In other machines, the central processing unit 91 maycomprise multiple processors. Coprocessor 81 is an optional processor,distinct from main CPU 91, that performs additional functions or assistsCPU 91. CPU 91 and/or coprocessor 81 may receive, generate, and processdata related to the disclosed systems and methods for E2E M2M servicelayer sessions, such as receiving session credentials or authenticatingbased on session credentials.

In operation, CPU 91 fetches, decodes, and executes instructions, andtransfers information to and from other resources via the computer'smain data-transfer path, system bus 80. Such a system bus connects thecomponents in computing system 90 and defines the medium for dataexchange. System bus 80 typically includes data lines for sending data,address lines for sending addresses, and control lines for sendinginterrupts and for operating the system bus. An example of such a systembus 80 is the PCI (Peripheral Component Interconnect) bus.

Memories coupled to system bus 80 include random access memory (RAM) 82and read only memory (ROM) 93. Such memories include circuitry thatallows information to be stored and retrieved. ROMs 93 generally containstored data that cannot easily be modified. Data stored in RAM 82 can beread or changed by CPU 91 or other hardware devices. Access to RAM 82and/or ROM 93 may be controlled by memory controller 92. Memorycontroller 92 may provide an address translation function thattranslates virtual addresses into physical addresses as instructions areexecuted. Memory controller 92 may also provide a memory protectionfunction that isolates processes within the system and isolates systemprocesses from user processes. Thus, a program running in a first modecan access only memory mapped by its own process virtual address space;it cannot access memory within another process's virtual address spaceunless memory sharing between the processes has been set up.

In addition, computing system 90 may contain peripherals controller 83responsible for communicating instructions from CPU 91 to peripherals,such as printer 94, keyboard 84, mouse 95, and disk drive 85.

Display 86, which is controlled by display controller 96, is used todisplay visual output generated by computing system 90. Such visualoutput may include text, graphics, animated graphics, and video. Display86 may be implemented with a CRT-based video display, an LCD-basedflat-panel display, gas plasma-based flat-panel display, or atouch-panel. Display controller 96 includes electronic componentsrequired to generate a video signal that is sent to display 86. Thedisplay 86 may be used, for example, to display the example graphicaluser interface illustrated in FIG. 38 and described below.

Further, computing system 90 may contain communication circuitry, suchas for example a network adaptor 97, that may be used to connectcomputing system 90 to an external communications network, such asnetwork 12 of FIG. 37A and FIG. 37B, to enable the computing system 90to communicate with other nodes of the network.

Example Graphical User Interface

FIG. 38 illustrates one embodiment of a graphical user interface 500that may be implemented to allow a user to interactively configure andmanage an end-to-end session migration policy. In one embodiment, thisgraphical user interface may be layered on top of the methods describedabove for establishing, managing, migrating, and sharing an end-to-endsession. In the illustrated embodiment, the graphical user interface maybe used by a user to create (or delete) a policy to govern the migrationof an E2E M2M service layer session. As shown, in window 502, a user mayselect which session context should be migrated. Window 504 may be usedto establish a migration schedule. Window 506 may be used to displayinformation about events associated with a current session. Window 508may be used to set service orchestration policies, such as whether toperform time/schedule based migration or event based migration. Windows510 and 512 may be used to identify from where and to where a migrationshould be performed. Window 514 may be used to enter and/or display anidentifier of the E2E M2M service layer session for which theconfiguration policy is being established, as well as a credentialassociated with the session. Buttons 516 and 518 may be used to causethe policy to be created or deleted, respectively.

In various embodiments, the graphical user interface 500 may beimplemented on any one or more nodes of an M2M, IoT, or WoT network,including end-user devices, terminals, gateways, or servers of suchnetworks, such as, for example, the devices 18, gateways 14, and servers22 of the example network of FIGS. 37A-37D, or any of the devices,gateways, or servers illustrated in other figures. For example, thegraphical user interface 500 may be implemented and displayed on thedisplay 42 of the example network node 30 illustrated in FIG. 37C or thedisplay 86 of the example computer system 90 of FIG. 37D.

It is understood that any or all of the systems, methods and processesdescribed herein may be embodied in the form of computer executableinstructions (i.e., program code) stored on a computer-readable storagemedium which instructions, when executed by a machine, such as a node ofan M2M network, including for example an M2M server, gateway, device orthe like, perform and/or implement the systems, methods and processesdescribed herein. Specifically, any of the steps, operations orfunctions described above may be implemented in the form of suchcomputer executable instructions. Computer readable storage mediainclude both volatile and nonvolatile, removable and non-removable mediaimplemented in any non-transitory (i.e., tangible or physical) method ortechnology for storage of information, but such computer readablestorage media do not includes signals. Computer readable storage mediainclude, but are not limited to, RAM, ROM, EEPROM, flash memory or othermemory technology, CD-ROM, digital versatile disks (DVD) or otheroptical disk storage, magnetic cassettes, magnetic tape, magnetic diskstorage or other magnetic storage devices, or any other tangible orphysical medium which can be used to store the desired information andwhich can be accessed by a computer.

In describing preferred embodiments of the subject matter of the presentdisclosure, as illustrated in the Figures, specific terminology isemployed for the sake of clarity. The claimed subject matter, however,is not intended to be limited to the specific terminology so selected,and it is to be understood that each specific element includes alltechnical equivalents that operate in a similar manner to accomplish asimilar purpose.

This written description uses examples to disclose the invention,including the best mode, and also to enable any person skilled in theart to practice the invention, including making and using any devices orsystems and performing any incorporated methods. The patentable scope ofthe invention is defined by the claims, and may include other examplesthat occur to those skilled in the art. Such other examples are intendedto be within the scope of the claims if they have elements that do notdiffer from the literal language of the claims, or if they includeequivalent elements with insubstantial differences from the literallanguage of the claims.

What is claimed:
 1. A node comprising a processor, a memory, andcommunication circuitry, the node being connected to a communicationsnetwork via its communication circuitry and operating as a gateway orserver in the network, the node further including computer-executableinstructions stored in the memory of the node which, when executed bythe processor of the node, perform functions of an instance of a servicelayer of the network and cause the node to: store, in the memory of thenode, context comprising information concerning a communication sessionestablished between the service layer instance of the node and anapplication executing on a second node connected to the network; and inresponse to a trigger condition indicating that the communicationsession between the service layer instance of the node and theapplication of the second node is to be migrated to or shared with athird node, transmit the stored context for the communication sessionfrom the node to a service layer instance executing on the third node.2. The node recited in claim 1, wherein the trigger condition indicatesthat the communication session is to be migrated, and wherein after thestored session context is transmitted to the service layer instanceexecuting on the third node, the service layer instance of the nodedeletes the session context from the memory of the node.
 3. The noderecited in claim 1, wherein the session context stored for thecommunication session comprises one or more of (i) informationspecifying a schedule by which migration or sharing of the communicationsession is to be performed; (ii) information defining policies by whichmigration or sharing of the communication session is to be performed;and (iii) information specifying events that may result in said triggercondition indicating that the communication session is to be migrated orshared.
 4. The node recited in claim 3, wherein the session contextstored for the communication session further comprises one or more of(i) information identifying other communication session participants towhich notifications concerning the communication session are to betransmitted; (ii) an identifier of the communication session; (iii)security credentials to be used by participants of the communicationsession; (iv) information regarding session activity; (v) informationregarding the routing of messages to participants of the communicationsession; (vi) information regarding locations of participants to thecommunication session; (vii) data collected and stored on behalf ofparticipants of the communication session; (viii) information tofacilitate discovery of the communication session by other participants;(ix) information relating to transactions performed using thecommunication session; and (x) information concerning access networksessions or transport layer sessions that underlie the communicationsession.
 5. The node recited in claim 1, wherein the session context isstored in one or more resources created and maintained by the servicelayer instance of the node.
 6. The node recited in claim 1, whereintransmitting the stored context for the communication session from thenode to a service layer instance executing on the third node comprisestransmitting the stored context for the communication session from thenode to a service layer instance executing on an intermediate node,which intermediate node then forwards the communication session contextto the third node.
 7. The node recited in claim 1, wherein the triggercondition is autonomously generated by the service layer instance of thenode.
 8. The node recited in claim 1, wherein the trigger condition iscaused by a participant of the communication session.
 9. A nodecomprising a processor, a memory, and communication circuitry, the nodebeing connected to a communications network via its communicationcircuitry and operating as a gateway or server in the network, the nodefurther including computer-executable instructions stored in the memoryof the node which, when executed by the processor of the node, performfunctions of an instance of a service layer of the network and cause thenode to: in response to an application executing on a second nodeconnected to the network registering with the service layer instance ofthe node, wherein the application of the second node had previouslyestablished a communication session with a service layer instance of athird node and wherein a communication session identifier associatedwith the previously established session is received from the secondnode, determine whether the previously established session identified bythe session identifier can be migrated from the service layer instanceof the third node to the service layer instance of the node; if it isdetermined that the session identified by the session identifier can bemigrated from the third node, retrieve session context for the sessionfrom the service layer instance of the third node via the network; andre-establish the session between the application of the second node andthe service layer instance of the node based on the session contextretrieved from the service layer instance of the third node.
 10. Thenode recited in claim 9, wherein determining whether the sessionidentified by the session identifier received from the second node canbe migrated comprises querying a service layer instance of another nodethat maintained information about the previous session between theapplication of the second node and the service layer instance of thethird node.
 11. The node recited in claim 9, wherein the determinationwhether the session identified by the session identifier received fromthe second node can be migrated is based on a policy specified by thesession context retrieved from the third node.
 12. The node recited inclaim 9, wherein the session context retrieved from the service layerinstance of the third node comprises one or more of (i) informationspecifying a schedule by which migration or sharing of the communicationsession is to be performed; (ii) information defining policies by whichmigration or sharing of the communication session is to be performed;and (iii) information specifying events that may trigger thecommunication session to be migrated or shared.
 13. The node recited inclaim 12, wherein the session context retrieved from the service layerinstance of the third node further comprises one or more of (i)information identifying other communication session participants towhich notifications concerning the communication session are to betransmitted; (ii) an identifier of the communication session; (iii)security credentials to be used by participants of the communicationsession; (iv) information regarding session activity; (v) informationregarding the routing of messages to participants of the communicationsession; (vi) information regarding locations of participants to thecommunication session; (vii) data collected and stored on behalf ofparticipants of the communication session; (viii) information tofacilitate discovery of the communication session by other participants;(ix) information relating to transactions performed using thecommunication session; and (x) information concerning access networksessions or transport layer sessions that underlie the communicationsession.
 14. A method for use by a node operating as a gateway or serverin a network, wherein the node comprises a processor, a memory, andcommunication circuitry, and wherein the node is connected to thenetwork via its communication circuitry and further includescomputer-executable instructions stored in the memory of the node which,when executed by the processor of the node, perform functions of aninstance of a service layer of the network, the method comprising:storing, in the memory of the node, context comprising informationconcerning a communication session established between the service layerinstance of the node and an application executing on a second nodeconnected to the network; and in response to a trigger conditionindicating that the communication session between the service layerinstance of the node and the application of the second node is to bemigrated to or shared with a third node, transmitting the stored contextfor the communication session from the node to a service layer instanceexecuting on the third node.
 15. The method recited in claim 14, whereinthe trigger condition indicates that the communication session is to bemigrated, the method further comprising: after transmitting the storedsession context to the service layer instance executing on the thirdnode, deleting the session context from the memory of the node.
 16. Themethod recited in claim 14, wherein the session context stored for thecommunication session comprises one or more of (i) informationspecifying a schedule by which migration or sharing of the communicationsession is to be performed; (ii) information defining policies by whichmigration or sharing of the communication session is to be performed;and (iii) information specifying events that may result in said triggercondition indicating that the communication session is to be migrated orshared.
 17. The method recited in claim 16, wherein the session contextstored for the communication session further comprises one or more of(i) information identifying other communication session participants towhich notifications concerning the communication session are to betransmitted; (ii) an identifier of the communication session; (iii)security credentials to be used by participants of the communicationsession; (iv) information regarding session activity; (v) informationregarding the routing of messages to participants of the communicationsession; (vi) information regarding locations of participants to thecommunication session; (vii) data collected and stored on behalf ofparticipants of the communication session; (viii) information tofacilitate discovery of the communication session by other participants;(ix) information relating to transactions performed using thecommunication session; and (x) information concerning access networksessions or transport layer sessions that underlie the communicationsession.
 18. The method recited in claim 14, wherein the session contextis stored in one or more resources created and maintained by the servicelayer instance of the node.
 19. The method recited in claim 14, whereintransmitting the stored context for the communication session from thenode to a service layer instance executing on the third node comprisestransmitting the stored context for the communication session from thenode to a service layer instance executing on an intermediate node,which intermediate node then forwards the communication session contextto the third node.
 20. The method recited in claim 14, wherein thetrigger condition is autonomously generated by the service layerinstance of the node.
 21. The method recited in claim 14, wherein thetrigger condition is caused by a participant of the communicationsession.
 22. A method for use by a node operating as a gateway or serverin a network, wherein the node comprises a processor, a memory, andcommunication circuitry, and wherein the node is connected to thenetwork via its communication circuitry and further includescomputer-executable instructions stored in the memory of the node which,when executed by the processor of the node, perform functions of aninstance of a service layer of the network, the method comprising: inresponse to an application executing on a second node connected to thenetwork registering with the service layer instance of the node, whereinthe application of the second node had previously established acommunication session with a service layer instance of a third node andwherein a communication session identifier associated with thepreviously established session is received from the second node,determining whether the previously established session identified by thesession identifier can be migrated from the service layer instance ofthe third node to the service layer instance of the node; if it isdetermined that the session identified by the session identifier can bemigrated from the third node, retrieving session context for the sessionfrom the service layer instance of the third node via the network; andre-establishing the session between the application of the second nodeand the service layer instance of the node based on the session contextretrieved from the service layer instance of the third node.
 23. Themethod recited in claim 22, wherein determining whether the sessionidentified by the session identifier received from the second node canbe migrated comprises querying a service layer instance of another nodethat maintained information about the previous session between theapplication of the second node and the service layer instance of thethird node.
 24. The method recited in claim 22, wherein thedetermination whether the session identified by the session identifierreceived from the second node can be migrated is based on a policyspecified by the session context retrieved from the third node.
 25. Themethod recited in claim 22, wherein the session context retrieved fromthe service layer instance of the third node comprises one or more of(i) information specifying a schedule by which migration or sharing ofthe communication session is to be performed; (ii) information definingpolicies by which migration or sharing of the communication session isto be performed; and (iii) information specifying events that maytrigger the communication session to be migrated or shared.
 26. Themethod recited in claim 25, wherein the session context retrieved fromthe service layer instance of the third node further comprises one ormore of (i) information identifying other communication sessionparticipants to which notifications concerning the communication sessionare to be transmitted; (ii) an identifier of the communication session;(iii) security credentials to be used by participants of thecommunication session; (iv) information regarding session activity; (v)information regarding the routing of messages to participants of thecommunication session; (vi) information regarding locations ofparticipants to the communication session; (vii) data collected andstored on behalf of participants of the communication session; (viii)information to facilitate discovery of the communication session byother participants; (ix) information relating to transactions performedusing the communication session; and (x) information concerning accessnetwork sessions or transport layer sessions that underlie thecommunication session.